Skip to content

Commit

Permalink
Update files
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub Action <action@github.com>
  • Loading branch information
actions-user committed Jan 28, 2024
1 parent 0fba881 commit b01f513
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 12 deletions.
1 change: 1 addition & 0 deletions custom_components/xplora_watch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support for Xplora® Watch Version 2."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Reads watch status from Xplora® Watch Version 2."""

from __future__ import annotations

import logging
Expand Down
9 changes: 6 additions & 3 deletions custom_components/xplora_watch/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow for Xplora® Watch Version 2."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -342,9 +343,11 @@ async def async_step_init(self, user_input: dict[str, Any] | None = None) -> Flo
language: str = _options.get(CONF_LANGUAGE, self.config_entry.data.get(CONF_LANGUAGE, DEFAULT_LANGUAGE))

signin_typ = [
SIGNIN.get(language, SIGNIN[DEFAULT_LANGUAGE]).get(CONF_EMAIL)
if CONF_EMAIL in self.config_entry.data
else SIGNIN.get(language, SIGNIN[DEFAULT_LANGUAGE]).get(CONF_PHONENUMBER)
(
SIGNIN.get(language, SIGNIN[DEFAULT_LANGUAGE]).get(CONF_EMAIL)
if CONF_EMAIL in self.config_entry.data
else SIGNIN.get(language, SIGNIN[DEFAULT_LANGUAGE]).get(CONF_PHONENUMBER)
)
]

_home_zone = self.hass.states.get(HOME).attributes
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Const for Xplora® Watch Version 2."""

from __future__ import annotations

from typing import Final
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/const_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Const schema for Xplora® Watch Version 2."""

from __future__ import annotations

import voluptuous as vol
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/coordinator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Coordinator for Xplora® Watch Version 2."""

from __future__ import annotations

import logging
Expand Down
13 changes: 7 additions & 6 deletions custom_components/xplora_watch/device_tracker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support for Xplora® Watch Version 2 tracking."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -235,12 +236,12 @@ def extra_state_attributes(self) -> dict[str, Any]:
**{
ATTR_SERVICE_USER: self.coordinator.username,
ATTR_TRACKER_DISTOHOME: distance_to_home,
ATTR_TRACKER_ADDR: self.coordinator.data[self.watch_uid].get(ATTR_LOCATION_NAME, None)
if distance_to_home
else None,
ATTR_TRACKER_LAST_TRACK: self.coordinator.data[self.watch_uid].get("lastTrackTime", None)
if distance_to_home
else None,
ATTR_TRACKER_ADDR: (
self.coordinator.data[self.watch_uid].get(ATTR_LOCATION_NAME, None) if distance_to_home else None
),
ATTR_TRACKER_LAST_TRACK: (
self.coordinator.data[self.watch_uid].get("lastTrackTime", None) if distance_to_home else None
),
ATTR_TRACKER_IMEI: self.coordinator.data[self.watch_uid].get(ATTR_TRACKER_IMEI, None),
ATTR_TRACKER_POI: self.coordinator.data[self.watch_uid].get(ATTR_TRACKER_POI, None),
ATTR_TRACKER_LICENCE: self.coordinator.data[self.watch_uid].get(ATTR_TRACKER_LICENCE, None),
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/entity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Entity for Xplora® Watch Version 2 tracking."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/geocoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Version: 2.4.0
https://raw.githubusercontent.com/OpenCageData/python-opencage-geocoder/master/LICENSE.txt
"""

from __future__ import annotations

import collections
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/helper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""HelperClasses Xplora® Watch Version 2."""

from __future__ import annotations

import base64
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/notify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Send Message to watch from Xplora® Watch Version 2."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Reads watch status from Xplora® Watch Version 2."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/xplora_watch/services.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support for Xplora® Watch Version 2 send/read message, manually refresh and shutdown."""

from __future__ import annotations

import logging
Expand Down
9 changes: 6 additions & 3 deletions custom_components/xplora_watch/switch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Reads watch status from Xplora® Watch Version 2."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -204,9 +205,11 @@ 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
"_", " "
).title()
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(
Expand Down

0 comments on commit b01f513

Please sign in to comment.