S allius/issue391 (#392)
* design counter on connection board * display time of last update and add reload button * chance `Updated` field to a real button * Provide counter values for the dashboard * change background color ot the top branch - use dark-grey instead of black to reduce the contrast * change color of counter tiles * test proxy connection counter handling * prepare conn-table and notes list building * remove obsolete menue points * store client mode for dashboard * store inverters serial number for the dashboard * store inverters serial number * build connection table for dashboard * add connection table to dashboard * fix responsiveness of the tiles * adapt unit tests * remove test fake code * increase test coverage, remove obsolete if statement
This commit is contained in:
@@ -838,7 +838,10 @@ class Infos:
|
||||
def inc_counter(cls, counter: str) -> None:
|
||||
'''inc proxy statistic counter'''
|
||||
db_dict = cls.stat['proxy']
|
||||
db_dict[counter] += 1
|
||||
try:
|
||||
db_dict[counter] += 1
|
||||
except Exception:
|
||||
db_dict[counter] = 1
|
||||
cls.new_stat_data['proxy'] = True
|
||||
|
||||
@classmethod
|
||||
@@ -848,6 +851,15 @@ class Infos:
|
||||
db_dict[counter] -= 1
|
||||
cls.new_stat_data['proxy'] = True
|
||||
|
||||
@classmethod
|
||||
def get_counter(cls, counter: str) -> int:
|
||||
'''get proxy statistic counter'''
|
||||
try:
|
||||
db_dict = cls.stat['proxy']
|
||||
return db_dict[counter]
|
||||
except Exception:
|
||||
return 0
|
||||
|
||||
def ha_proxy_confs(self, ha_prfx: str, node_id: str, snr: str) \
|
||||
-> Generator[tuple[str, str, str, str], None, None]:
|
||||
'''Generator function yields json register struct for home-assistant
|
||||
|
||||
Reference in New Issue
Block a user