Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33fcee6

Browse files
authored
Add example for python_script sensors
1 parent1b2212e commit33fcee6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

‎README.md‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,17 @@ sensor:
210210
filename = self.hass.config.path('home-assistant_v2.db')
211211
self.state = round(os.stat(filename).st_size / 1_000_000, 1)
212212
213-
- platform: python_script
214-
name: Instance external url #more info https://developers.home-assistant.io/docs/instance_url/
215-
scan_interval: '01:00:00' # optional
216-
source: |
217-
from homeassistant.helpers import network
218-
try:
219-
self.state = network.get_url(
220-
self.hass,
221-
allow_internal=False,
222-
)
223-
except network.NoURLAvailableError:
224-
raise MyInvalidValueError("Failed to find suitable URL for my integration")
213+
- platform: python_script
214+
name: Instance external url #more info https://developers.home-assistant.io/docs/instance_url/
215+
scan_interval: '01:00:00' # optional
216+
source: |
217+
from homeassistant.helpers import network
218+
try:
219+
self.state = network.get_url(
220+
self.hass,
221+
allow_internal=False,
222+
)
223+
except network.NoURLAvailableError:
224+
raise MyInvalidValueError("Failed to find suitable URL for my integration")
225225
226226
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp