adapt interface of ha_confs

This commit is contained in:
Stefan Allius
2023-11-01 21:09:57 +01:00
parent 387bab01be
commit 85be9072db

View File

@@ -159,7 +159,7 @@ class Infos:
return not value <= dep['less_eq'] return not value <= dep['less_eq']
return True return True
def ha_confs(self, ha_prfx, inv_node_id, inv_snr, proxy_node_id, proxy_unique_id, sug_area =''): def ha_confs(self, ha_prfx, node_id, snr, singleton:bool, sug_area =''):
'''Generator function yields a json register struct for home-assistant auto configuration and a unique entity string '''Generator function yields a json register struct for home-assistant auto configuration and a unique entity string
arguments: arguments:
@@ -169,12 +169,11 @@ class Infos:
tab = self.__info_defs tab = self.__info_defs
for key in tab: for key in tab:
row = tab[key] row = tab[key]
if 'singleton' in row and row['singleton']: if 'singleton' in row:
node_id = proxy_node_id if singleton != row['singleton']:
snr = proxy_unique_id continue
else: elif singleton:
node_id = inv_node_id continue
snr = inv_snr
prfx = ha_prfx + node_id prfx = ha_prfx + node_id
#check if we have details for home assistant #check if we have details for home assistant