Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

Commit 5dd8269

Browse files
authored
Move notify to after hostname lookup (#73)
* Move notify to after hostname lookup * Add iot_class * fix version
1 parent ffbbab7 commit 5dd8269

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.devcontainer/configuration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
default_config:
22
logger:
3-
default: error
3+
default: info
44
logs:
55
custom_components.authenticated: debug
66

.devcontainer/devcontainer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Custom integration authenticated",
3-
"image": "ludeeus/container:integration",
3+
"image": "ghcr.io/ludeeus/devcontainer/integration:stable",
44
"context": "..",
55
"appPort": [
66
"9123:8123"
@@ -11,8 +11,8 @@
1111
"github.vscode-pull-request-github",
1212
"ryanluker.vscode-coverage-gutters",
1313
"ms-python.vscode-pylance"
14-
],
15-
"settings": {
14+
],
15+
"settings": {
1616
"files.eol": "\n",
1717
"editor.tabSize": 4,
1818
"terminal.integrated.shell.linux": "/bin/bash",
@@ -24,5 +24,5 @@
2424
"editor.formatOnSave": true,
2525
"editor.formatOnType": true,
2626
"files.trimTrailingWhitespace": true
27-
}
27+
}
2828
}

custom_components/authenticated/manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"domain": "authenticated",
33
"name": "Authenticated",
4-
"version": "v0.0.0",
4+
"version": "0.0.0",
5+
"iot_class": "local_polling",
56
"documentation": "https://github.com/custom-components/authenticated",
67
"issue_tracker": "https://github.com/custom-components/authenticated/issues",
78
"codeowners": [

custom_components/authenticated/sensor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,15 @@ def update(self):
201201
accessdata = AuthenticatedData(access, tokens[access])
202202
ipaddress = IPData(accessdata, users, self.provider)
203203
ipaddress.lookup()
204-
if ipaddress.new_ip:
205-
if self.notify:
206-
ipaddress.notify(self.hass)
207-
ipaddress.new_ip = False
208204

209205
if ipaddress.hostname is None:
210206
ipaddress.hostname = get_hostname(ipaddress.ip_address)
211207

208+
if ipaddress.new_ip:
209+
if self.notify:
210+
ipaddress.notify(self.hass)
211+
ipaddress.new_ip = False
212+
212213
self.hass.data[PLATFORM_NAME][access] = ipaddress
213214

214215
for ipaddr in sorted(

0 commit comments

Comments
 (0)