Skip to content

Commit 613abc9

Browse files
Merge branch 'comp2' of github.com:springfall2008/batpred into comp2
2 parents bce10c8 + ba07787 commit 613abc9

4 files changed

Lines changed: 9 additions & 14 deletions

File tree

‎.cspell.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"ignorePaths": [
1515
"**/*.json",
1616
"**/*.yaml",
17+
".gitignore",
1718
],
1819
"import": [
1920
"@cspell/dict-en-gb/cspell-ext.json"

‎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
@@ -49,6 +49,7 @@ class HAInterface:
4949
"""
5050
Direct interface to Home Assistant
5151
"""
52+
5253
def is_active(self):
5354
return self.is_alive()
5455

@@ -126,12 +127,11 @@ def __init__(self, ha_url, ha_key, db_enable, db_mirror_ha, db_primary, base):
126127
self.db_manager = self.base.components.get_component("db")
127128

128129
# API Has started
129-
self.base.ha_interface = self # Set pointer back to ourselves as other components require this one
130+
self.base.ha_interface = self # Set pointer back to ourselves as other components require this one
130131
self.api_started = True
131132

132133
async def start(self):
133-
""" Async start not required
134-
"""
134+
"""Async start not required"""
135135
self.log("Info: Starting HA interface")
136136
self.websocket_active = True
137137
await self.socketLoop()

0 commit comments

Comments
 (0)