Skip to content

Commit

Permalink
Fix #19 (Compatibility HA2024.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
juacas committed May 3, 2024
1 parent d1ec2a3 commit 8e6be3f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions custom_components/zte_tracker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

_LOGGER = logging.getLogger(__name__)

def setup(hass, config):
def setup(hass: HomeAssistant, config: ConfigEntry):
"""Set up is called when Home Assistant is loading our component."""
plattform_conf = config.get(DOMAIN)
_LOGGER.debug("Client initialized for ZTE {0} @{1}".format(plattform_conf[CONF_MODEL]
Expand Down Expand Up @@ -65,7 +65,7 @@ def handle_pause(call):

# Load platforms
for platform in PLATFORMS:
hass.async_create_task(
hass.create_task(
discovery.async_load_platform(
hass, platform, DOMAIN, plattform_conf, config
)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/zte_tracker/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

DOMAIN = "zte_tracker"
DOMAIN_DATA = "{}_data".format(DOMAIN)
VERSION = "1.3.7"
VERSION = "1.3.9"
PLATFORMS = ["sensor", "device_tracker"]
ISSUE_URL = "https://github.com/juacas/zte_tracker/issues"
DEFAULT_HOST = '192.168.1.1'
Expand Down
2 changes: 1 addition & 1 deletion custom_components/zte_tracker/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def _get_data(self)->list:
self.scanning = False
return []
elif not self.router_client.login():
self.statusmsg = self.router_client.statusmsg
self.scanning = False
_LOGGER.warning("Login failed: {0}@{1}".format(self.router_client.username, self.router_client.host))
self.router_client.logout()
Expand All @@ -120,6 +119,7 @@ def _get_data(self)->list:
finally:
self.router_client.logout()

self.statusmsg = self.router_client.statusmsg
self.scanning = True

# Create a list of Device tuples.
Expand Down
2 changes: 1 addition & 1 deletion custom_components/zte_tracker/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/juacas/zte_tracker/issues",
"requirements": [],
"version": "v1.3.8"
"version": "v1.3.9"
}

0 comments on commit 8e6be3f

Please sign in to comment.