Skip to content

Commit d3b0516

Browse files
authored
Merge pull request #128 from PimDoos/dev
Improve exception handling & fetch serial number on setup
2 parents 5ef0753 + 26ab43e commit d3b0516

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

custom_components/sessy/coordinator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
UpdateFailed,
1717
)
1818
from sessypy.devices import SessyBattery, SessyCTMeter, SessyDevice, SessyMeter, SessyP1Meter
19-
from sessypy.util import SessyConnectionException, SessyLoginException, SessyNotSupportedException
19+
from sessypy.util import SessyException, SessyLoginException
2020

2121
from .const import COORDINATOR_RETRIES, COORDINATOR_RETRY_DELAY, DEFAULT_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL_POWER, ENTITY_ERROR_THRESHOLD, SCAN_INTERVAL_OTA_CHECK, SCAN_INTERVAL_SCHEDULE
2222
from .models import SessyConfigEntry
@@ -158,7 +158,7 @@ async def _async_update_data(self):
158158
# Raising ConfigEntryAuthFailed will cancel future updates
159159
# and start a config flow with SOURCE_REAUTH (async_step_reauth)
160160
raise ConfigEntryAuthFailed from err
161-
except SessyConnectionException as err:
161+
except SessyException as err:
162162
await asyncio.sleep(COORDINATOR_RETRY_DELAY)
163163
continue
164164

custom_components/sessy/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"integration_type": "device",
1111
"iot_class": "local_polling",
1212
"issue_tracker": "https://github.com/PimDoos/ha-sessy/issues",
13-
"requirements": ["sessypy==0.1.15"],
14-
"version": "0.8.2",
13+
"requirements": ["sessypy==0.2.0"],
14+
"version": "0.8.3",
1515
"zeroconf":[
1616
{"type":"_http._tcp.local.","name":"sessy-*"}
1717
]

custom_components/sessy/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ async def generate_device_info(hass: HomeAssistant, config_entry: ConfigEntry, d
9090
manufacturer="Charged B.V.",
9191
identifiers={(DOMAIN, device.serial_number)},
9292
configuration_url=f"http://{device.host}/",
93-
model=model
93+
model=model,
94+
serial_number=device.serial_number,
9495
)
9596

9697
return device_info

0 commit comments

Comments
 (0)