Skip to content

Commit ba07787

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 542baa9 commit ba07787

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

‎apps/predbat/components.py‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"args": {
2525
"db_enable": {"required": True, "config": "db_enable"},
2626
"db_days": {"required": False, "config": "db_days", "default": 30},
27-
}
27+
},
2828
},
2929
"ha": {
3030
"class": HAInterface,
@@ -35,15 +35,9 @@
3535
"db_enable": {"required": False, "config": "db_enable", "default": False},
3636
"db_mirror_ha": {"required": False, "config": "db_mirror_ha", "default": False},
3737
"db_primary": {"required": False, "config": "db_primary", "default": False},
38-
}
39-
},
40-
"web": {
41-
"class": WebInterface,
42-
"name": "Web Interface",
43-
"args": {
44-
"port": {"required": False, "config": "web_port", "default": 5052}
45-
}
38+
},
4639
},
40+
"web": {"class": WebInterface, "name": "Web Interface", "args": {"port": {"required": False, "config": "web_port", "default": 5052}}},
4741
"gecloud": {
4842
"class": GECloudDirect,
4943
"name": "GivEnergy Cloud Direct",
@@ -170,7 +164,7 @@ def is_alive(self, name):
170164
return False
171165
if not self.components[name]:
172166
# Disabled components can be ignored
173-
return True
167+
return True
174168
if not self.component_tasks[name] or not self.component_tasks[name].is_alive():
175169
return False
176170
if not self.components[name].is_alive():

‎apps/predbat/db_manager.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def bridge_event(self, loop):
4343
def is_alive(self):
4444
"""Check if the database manager is alive"""
4545
return self.api_started
46-
46+
4747
def wait_api_started(self):
4848
"""
4949
Wait for the API to start

‎apps/predbat/ha.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class HAInterface:
5151
"""
5252
Direct interface to Home Assistant
5353
"""
54+
5455
def is_active(self):
5556
return self.is_alive()
5657

@@ -128,12 +129,11 @@ def __init__(self, ha_url, ha_key, db_enable, db_mirror_ha, db_primary, base):
128129
self.db_manager = self.base.components.get_component("db")
129130

130131
# API Has started
131-
self.base.ha_interface = self # Set pointer back to ourselves as other components require this one
132+
self.base.ha_interface = self # Set pointer back to ourselves as other components require this one
132133
self.api_started = True
133134

134135
async def start(self):
135-
""" Async start not required
136-
"""
136+
"""Async start not required"""
137137
self.log("Info: Starting HA interface")
138138
self.websocket_active = True
139139
await self.socketLoop()

0 commit comments

Comments
 (0)