Skip to content

Commit

Permalink
fixes #456 (#464)
Browse files Browse the repository at this point in the history
* fixes #456

Signed-off-by: Ludy87 <Ludy87@users.noreply.github.com>

* files reformatted

Signed-off-by: Ludy87 <Ludy87@users.noreply.github.com>

---------

Signed-off-by: Ludy87 <Ludy87@users.noreply.github.com>
  • Loading branch information
Ludy87 authored Jan 17, 2025
1 parent a3dd6fa commit 32741c6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
5 changes: 1 addition & 4 deletions custom_components/xplora_watch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
await move_emojis_directory(hass)
await create_service_yaml_file(hass, entry, watches)

# Create a copy and remove Platform.NOTIFY
PLATFORMS_COPY = [platform for platform in PLATFORMS if platform != Platform.NOTIFY]

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS_COPY)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

hass.async_create_task(
discovery.async_load_platform(
Expand Down
2 changes: 1 addition & 1 deletion custom_components/xplora_watch/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
super().__init__(
hass,
_LOGGER,
name=f'{DOMAIN}-{entry.data[CONF_PHONENUMBER][5:] if CONF_EMAIL not in entry.data else ""}',
name=f"{DOMAIN}-{entry.data[CONF_PHONENUMBER][5:] if CONF_EMAIL not in entry.data else ''}",
update_method=self.async_update_xplora_data,
update_interval=_update_interval,
)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/xplora_watch/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(
)

self._attr_unique_id = (
f'{ward.get(CONF_NAME)}_{ATTR_WATCH}_safezone_{safezone["vendorId"]}_{wuid}_{coordinator.user_id}'.replace(
f"{ward.get(CONF_NAME)}_{ATTR_WATCH}_safezone_{safezone['vendorId']}_{wuid}_{coordinator.user_id}".replace(
" ", "_"
)
.replace("-", "_")
Expand Down
2 changes: 1 addition & 1 deletion custom_components/xplora_watch/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"marshmallow-enum",
"security>=1.2"
],
"version": "v2.14.1"
"version": "v2.14.2"
}
8 changes: 4 additions & 4 deletions custom_components/xplora_watch/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ def __init__(
self._alarm = alarm

self._attr_name: str = (
f'{ward.get(CONF_NAME)} {ATTR_WATCH} {description.key} {alarm["start"]} ({coordinator.username})'.replace(
f"{ward.get(CONF_NAME)} {ATTR_WATCH} {description.key} {alarm['start']} ({coordinator.username})".replace(
"_", " "
).title()
)

self._attr_unique_id = (
f'{ward.get(CONF_NAME)}_{ATTR_WATCH}_{description.key}_{alarm["vendorId"]}_{wuid}_{coordinator.user_id}'.replace(
f"{ward.get(CONF_NAME)}_{ATTR_WATCH}_{description.key}_{alarm['vendorId']}_{wuid}_{coordinator.user_id}".replace(
" ", "_"
)
.replace("-", "_")
Expand Down Expand Up @@ -201,12 +201,12 @@ def __init__(

self._silent = silent

self._attr_name: str = f'{ward.get(CONF_NAME)} {ATTR_WATCH} {description.key} {silent["start"]}-{silent["end"]} ({coordinator.username})'.replace( # noqa: E501
self._attr_name: str = f"{ward.get(CONF_NAME)} {ATTR_WATCH} {description.key} {silent['start']}-{silent['end']} ({coordinator.username})".replace( # noqa: E501
"_", " "
).title()

self._attr_unique_id = (
f'{ward.get(CONF_NAME)}_{ATTR_WATCH}_{description.key}_{silent["vendorId"]}_{wuid}_{coordinator.user_id}'.replace(
f"{ward.get(CONF_NAME)}_{ATTR_WATCH}_{description.key}_{silent['vendorId']}_{wuid}_{coordinator.user_id}".replace(
" ", "_"
)
.replace("-", "_")
Expand Down

0 comments on commit 32741c6

Please sign in to comment.