homeassistant 2025.7.0b1__py3-none-any.whl → 2025.7.0b3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- homeassistant/components/ai_task/translations/hu.json +22 -0
- homeassistant/components/alexa_devices/manifest.json +1 -1
- homeassistant/components/alexa_devices/translations/cs.json +12 -1
- homeassistant/components/alexa_devices/translations/de.json +8 -0
- homeassistant/components/alexa_devices/translations/el.json +8 -0
- homeassistant/components/alexa_devices/translations/es.json +12 -1
- homeassistant/components/alexa_devices/translations/et.json +8 -0
- homeassistant/components/alexa_devices/translations/hu.json +4 -1
- homeassistant/components/alexa_devices/translations/pt.json +12 -1
- homeassistant/components/alexa_devices/translations/sk.json +8 -0
- homeassistant/components/alexa_devices/translations/zh-Hans.json +12 -1
- homeassistant/components/alexa_devices/translations/zh-Hant.json +8 -0
- homeassistant/components/altruist/translations/hu.json +19 -0
- homeassistant/components/anthropic/__init__.py +6 -0
- homeassistant/components/anthropic/translations/hu.json +19 -0
- homeassistant/components/assist_satellite/translations/hu.json +38 -0
- homeassistant/components/backup/translations/de.json +1 -1
- homeassistant/components/comelit/translations/de.json +1 -1
- homeassistant/components/counter/translations/sv.json +2 -2
- homeassistant/components/devolo_home_control/translations/hu.json +21 -0
- homeassistant/components/dsmr/sensor.py +8 -0
- homeassistant/components/electric_kiwi/translations/hu.json +6 -0
- homeassistant/components/enphase_envoy/translations/hu.json +18 -0
- homeassistant/components/enphase_envoy/translations/sv.json +3 -0
- homeassistant/components/fitbit/translations/hu.json +6 -0
- homeassistant/components/fronius/translations/sv.json +2 -2
- homeassistant/components/frontend/manifest.json +1 -1
- homeassistant/components/geocaching/translations/hu.json +6 -0
- homeassistant/components/google/translations/hu.json +6 -0
- homeassistant/components/google_assistant_sdk/translations/hu.json +6 -0
- homeassistant/components/google_drive/translations/hu.json +6 -0
- homeassistant/components/google_generative_ai_conversation/__init__.py +6 -0
- homeassistant/components/google_generative_ai_conversation/translations/cs.json +28 -0
- homeassistant/components/google_generative_ai_conversation/translations/hu.json +68 -0
- homeassistant/components/google_generative_ai_conversation/translations/pt.json +28 -0
- homeassistant/components/google_generative_ai_conversation/translations/sv.json +2 -0
- homeassistant/components/google_mail/translations/hu.json +6 -0
- homeassistant/components/google_photos/translations/hu.json +6 -0
- homeassistant/components/google_sheets/translations/hu.json +6 -0
- homeassistant/components/google_tasks/translations/hu.json +6 -0
- homeassistant/components/home_connect/translations/hu.json +6 -0
- homeassistant/components/homeassistant_hardware/firmware_config_flow.py +89 -7
- homeassistant/components/homeassistant_hardware/strings.json +2 -1
- homeassistant/components/homeassistant_hardware/translations/de.json +1 -0
- homeassistant/components/homeassistant_hardware/translations/en-GB.json +1 -0
- homeassistant/components/homeassistant_hardware/translations/en.json +1 -0
- homeassistant/components/homeassistant_hardware/translations/es.json +1 -0
- homeassistant/components/homeassistant_hardware/translations/et.json +1 -0
- homeassistant/components/homeassistant_hardware/translations/pt.json +1 -0
- homeassistant/components/homeassistant_hardware/translations/sv.json +1 -0
- homeassistant/components/homeassistant_hardware/translations/zh-Hant.json +1 -0
- homeassistant/components/homeassistant_sky_connect/config_flow.py +1 -1
- homeassistant/components/homeassistant_sky_connect/strings.json +4 -2
- homeassistant/components/homeassistant_sky_connect/translations/de.json +2 -0
- homeassistant/components/homeassistant_sky_connect/translations/en-GB.json +2 -0
- homeassistant/components/homeassistant_sky_connect/translations/en.json +2 -0
- homeassistant/components/homeassistant_sky_connect/translations/es.json +2 -0
- homeassistant/components/homeassistant_sky_connect/translations/et.json +2 -0
- homeassistant/components/homeassistant_sky_connect/translations/pt.json +2 -0
- homeassistant/components/homeassistant_sky_connect/translations/sv.json +2 -0
- homeassistant/components/homeassistant_sky_connect/translations/zh-Hant.json +2 -0
- homeassistant/components/homeassistant_yellow/strings.json +2 -1
- homeassistant/components/homeassistant_yellow/translations/bg.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/cs.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/de.json +1 -0
- homeassistant/components/homeassistant_yellow/translations/el.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/en-GB.json +2 -1
- homeassistant/components/homeassistant_yellow/translations/en.json +2 -1
- homeassistant/components/homeassistant_yellow/translations/es.json +1 -0
- homeassistant/components/homeassistant_yellow/translations/et.json +1 -0
- homeassistant/components/homeassistant_yellow/translations/fr.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/he.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/hu.json +1 -1
- homeassistant/components/homeassistant_yellow/translations/id.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/it.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/ja.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/lt.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/pt.json +1 -0
- homeassistant/components/homeassistant_yellow/translations/ru.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/sk.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/sv.json +1 -1
- homeassistant/components/homeassistant_yellow/translations/tr.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/zh-Hans.json +0 -1
- homeassistant/components/homeassistant_yellow/translations/zh-Hant.json +1 -0
- homeassistant/components/homee/translations/hu.json +25 -0
- homeassistant/components/homewizard/translations/sv.json +1 -1
- homeassistant/components/honeywell/manifest.json +1 -1
- homeassistant/components/husqvarna_automower/button.py +3 -1
- homeassistant/components/husqvarna_automower/translations/hu.json +6 -0
- homeassistant/components/input_number/translations/sv.json +2 -2
- homeassistant/components/input_text/translations/sv.json +1 -1
- homeassistant/components/iotty/translations/hu.json +6 -0
- homeassistant/components/iron_os/manifest.json +1 -1
- homeassistant/components/jellyfin/client_wrapper.py +1 -2
- homeassistant/components/jellyfin/coordinator.py +3 -0
- homeassistant/components/jellyfin/manifest.json +1 -2
- homeassistant/components/keenetic_ndms2/translations/hu.json +3 -0
- homeassistant/components/lamarzocco/entity.py +19 -1
- homeassistant/components/lamarzocco/number.py +0 -4
- homeassistant/components/lamarzocco/sensor.py +2 -4
- homeassistant/components/lametric/translations/hu.json +6 -0
- homeassistant/components/litterrobot/translations/hu.json +3 -0
- homeassistant/components/lyric/translations/hu.json +6 -0
- homeassistant/components/matter/translations/hu.json +10 -0
- homeassistant/components/mcp/translations/hu.json +6 -0
- homeassistant/components/microbees/translations/hu.json +6 -0
- homeassistant/components/miele/translations/hu.json +28 -1
- homeassistant/components/minecraft_server/translations/sv.json +1 -1
- homeassistant/components/monzo/translations/hu.json +6 -0
- homeassistant/components/motioneye/translations/sv.json +1 -1
- homeassistant/components/mqtt/translations/cs.json +19 -0
- homeassistant/components/mqtt/translations/nl.json +25 -0
- homeassistant/components/mqtt/translations/pt.json +2 -0
- homeassistant/components/myuplink/translations/hu.json +6 -0
- homeassistant/components/neato/translations/hu.json +6 -0
- homeassistant/components/nest/translations/hu.json +6 -0
- homeassistant/components/netatmo/translations/hu.json +6 -0
- homeassistant/components/ntfy/translations/hu.json +62 -1
- homeassistant/components/ntfy/translations/sv.json +1 -0
- homeassistant/components/number/translations/sv.json +2 -2
- homeassistant/components/nut/config_flow.py +4 -2
- homeassistant/components/ollama/__init__.py +6 -0
- homeassistant/components/ollama/translations/hu.json +33 -0
- homeassistant/components/ollama/translations/sv.json +1 -0
- homeassistant/components/ondilo_ico/translations/hu.json +6 -0
- homeassistant/components/onedrive/translations/hu.json +6 -0
- homeassistant/components/onewire/translations/sv.json +1 -1
- homeassistant/components/openai_conversation/__init__.py +6 -0
- homeassistant/components/openai_conversation/translations/hu.json +56 -0
- homeassistant/components/openai_conversation/translations/sv.json +4 -0
- homeassistant/components/paperless_ngx/translations/hu.json +4 -2
- homeassistant/components/pegel_online/translations/bg.json +1 -2
- homeassistant/components/pegel_online/translations/ca.json +1 -2
- homeassistant/components/pegel_online/translations/cs.json +1 -2
- homeassistant/components/pegel_online/translations/de.json +1 -1
- homeassistant/components/pegel_online/translations/el.json +1 -2
- homeassistant/components/pegel_online/translations/en-GB.json +1 -2
- homeassistant/components/pegel_online/translations/en.json +1 -1
- homeassistant/components/pegel_online/translations/es.json +1 -2
- homeassistant/components/pegel_online/translations/et.json +1 -2
- homeassistant/components/pegel_online/translations/fi.json +1 -2
- homeassistant/components/pegel_online/translations/fr.json +1 -2
- homeassistant/components/pegel_online/translations/hu.json +1 -2
- homeassistant/components/pegel_online/translations/id.json +1 -2
- homeassistant/components/pegel_online/translations/it.json +1 -2
- homeassistant/components/pegel_online/translations/ja.json +1 -2
- homeassistant/components/pegel_online/translations/ko.json +1 -2
- homeassistant/components/pegel_online/translations/lt.json +1 -2
- homeassistant/components/pegel_online/translations/lv.json +1 -2
- homeassistant/components/pegel_online/translations/nl.json +1 -2
- homeassistant/components/pegel_online/translations/pt.json +1 -2
- homeassistant/components/pegel_online/translations/ru.json +1 -2
- homeassistant/components/pegel_online/translations/sk.json +1 -2
- homeassistant/components/pegel_online/translations/sv.json +1 -2
- homeassistant/components/pegel_online/translations/tr.json +1 -2
- homeassistant/components/pegel_online/translations/zh-Hans.json +1 -2
- homeassistant/components/pegel_online/translations/zh-Hant.json +1 -2
- homeassistant/components/playstation_network/diagnostics.py +55 -0
- homeassistant/components/playstation_network/quality_scale.yaml +1 -1
- homeassistant/components/playstation_network/translations/hu.json +30 -0
- homeassistant/components/playstation_network/translations/pl.json +73 -0
- homeassistant/components/plugwise/translations/sv.json +2 -2
- homeassistant/components/point/translations/hu.json +6 -0
- homeassistant/components/random/translations/sv.json +4 -4
- homeassistant/components/senz/translations/hu.json +6 -0
- homeassistant/components/shelly/entity.py +6 -2
- homeassistant/components/smappee/translations/hu.json +6 -0
- homeassistant/components/smartthings/translations/hu.json +6 -0
- homeassistant/components/sonos/translations/cs.json +6 -0
- homeassistant/components/spotify/translations/hu.json +6 -0
- homeassistant/components/subaru/strings.json +2 -2
- homeassistant/components/subaru/translations/ca.json +0 -1
- homeassistant/components/subaru/translations/cs.json +0 -2
- homeassistant/components/subaru/translations/de.json +2 -2
- homeassistant/components/subaru/translations/el.json +0 -2
- homeassistant/components/subaru/translations/en-GB.json +2 -2
- homeassistant/components/subaru/translations/en.json +2 -2
- homeassistant/components/subaru/translations/es.json +2 -2
- homeassistant/components/subaru/translations/et.json +2 -2
- homeassistant/components/subaru/translations/fi.json +0 -1
- homeassistant/components/subaru/translations/hu.json +0 -2
- homeassistant/components/subaru/translations/it.json +0 -1
- homeassistant/components/subaru/translations/ja.json +0 -1
- homeassistant/components/subaru/translations/ko.json +0 -1
- homeassistant/components/subaru/translations/lt.json +0 -2
- homeassistant/components/subaru/translations/pt-BR.json +0 -1
- homeassistant/components/subaru/translations/pt.json +2 -2
- homeassistant/components/subaru/translations/ru.json +0 -2
- homeassistant/components/subaru/translations/sk.json +0 -2
- homeassistant/components/subaru/translations/sv.json +0 -2
- homeassistant/components/subaru/translations/tr.json +0 -2
- homeassistant/components/subaru/translations/zh-Hans.json +0 -2
- homeassistant/components/subaru/translations/zh-Hant.json +2 -2
- homeassistant/components/switchbot/translations/hu.json +19 -0
- homeassistant/components/switchbot/translations/sv.json +2 -0
- homeassistant/components/telegram_bot/config_flow.py +17 -10
- homeassistant/components/telegram_bot/manifest.json +1 -1
- homeassistant/components/telegram_bot/translations/cs.json +30 -0
- homeassistant/components/telegram_bot/translations/de.json +23 -1
- homeassistant/components/telegram_bot/translations/el.json +30 -0
- homeassistant/components/telegram_bot/translations/en-GB.json +3 -1
- homeassistant/components/telegram_bot/translations/es.json +30 -0
- homeassistant/components/telegram_bot/translations/et.json +24 -0
- homeassistant/components/telegram_bot/translations/hu.json +1 -0
- homeassistant/components/telegram_bot/translations/pt.json +30 -0
- homeassistant/components/telegram_bot/translations/sk.json +30 -0
- homeassistant/components/telegram_bot/translations/sv.json +23 -0
- homeassistant/components/telegram_bot/translations/zh-Hans.json +30 -0
- homeassistant/components/telegram_bot/translations/zh-Hant.json +30 -0
- homeassistant/components/tesla_fleet/translations/hu.json +7 -0
- homeassistant/components/teslemetry/coordinator.py +6 -6
- homeassistant/components/text/translations/sv.json +1 -1
- homeassistant/components/thermopro/strings.json +1 -1
- homeassistant/components/thermopro/translations/cs.json +0 -7
- homeassistant/components/thermopro/translations/de.json +1 -1
- homeassistant/components/thermopro/translations/el.json +0 -7
- homeassistant/components/thermopro/translations/en-GB.json +1 -1
- homeassistant/components/thermopro/translations/en.json +1 -1
- homeassistant/components/thermopro/translations/es.json +0 -7
- homeassistant/components/thermopro/translations/et.json +1 -1
- homeassistant/components/thermopro/translations/hu.json +0 -7
- homeassistant/components/thermopro/translations/ja.json +0 -7
- homeassistant/components/thermopro/translations/lt.json +0 -7
- homeassistant/components/thermopro/translations/nl.json +0 -7
- homeassistant/components/thermopro/translations/pt-BR.json +0 -7
- homeassistant/components/thermopro/translations/pt.json +0 -7
- homeassistant/components/thermopro/translations/ru.json +0 -7
- homeassistant/components/thermopro/translations/sk.json +0 -7
- homeassistant/components/thermopro/translations/sv.json +0 -7
- homeassistant/components/thermopro/translations/tr.json +0 -7
- homeassistant/components/thermopro/translations/zh-Hans.json +0 -7
- homeassistant/components/tilt_pi/translations/hu.json +21 -0
- homeassistant/components/toon/translations/hu.json +6 -0
- homeassistant/components/vegehub/translations/hu.json +11 -0
- homeassistant/components/vegehub/translations/sv.json +2 -1
- homeassistant/components/vicare/translations/sv.json +2 -2
- homeassistant/components/weheat/translations/hu.json +6 -0
- homeassistant/components/withings/translations/hu.json +6 -0
- homeassistant/components/wyoming/translations/sv.json +2 -2
- homeassistant/components/xbox/translations/hu.json +6 -0
- homeassistant/components/xiaomi_miio/translations/hu.json +7 -0
- homeassistant/components/yale/translations/hu.json +6 -0
- homeassistant/components/yolink/translations/hu.json +6 -0
- homeassistant/components/zha/translations/hu.json +6 -0
- homeassistant/components/zha/translations/sv.json +12 -0
- homeassistant/components/zwave_js/config_flow.py +84 -88
- homeassistant/components/zwave_js/strings.json +31 -15
- homeassistant/components/zwave_js/translations/bg.json +0 -3
- homeassistant/components/zwave_js/translations/cs.json +0 -17
- homeassistant/components/zwave_js/translations/de.json +27 -11
- homeassistant/components/zwave_js/translations/el.json +0 -17
- homeassistant/components/zwave_js/translations/en-GB.json +1 -17
- homeassistant/components/zwave_js/translations/en.json +25 -9
- homeassistant/components/zwave_js/translations/es.json +1 -17
- homeassistant/components/zwave_js/translations/et.json +25 -9
- homeassistant/components/zwave_js/translations/fi.json +0 -14
- homeassistant/components/zwave_js/translations/ga.json +0 -19
- homeassistant/components/zwave_js/translations/hu.json +0 -17
- homeassistant/components/zwave_js/translations/lt.json +0 -17
- homeassistant/components/zwave_js/translations/mk.json +0 -10
- homeassistant/components/zwave_js/translations/pt.json +10 -18
- homeassistant/components/zwave_js/translations/ru.json +0 -13
- homeassistant/components/zwave_js/translations/sk.json +0 -17
- homeassistant/components/zwave_js/translations/sv.json +0 -17
- homeassistant/components/zwave_js/translations/tr.json +0 -12
- homeassistant/components/zwave_js/translations/zh-Hans.json +0 -17
- homeassistant/components/zwave_js/translations/zh-Hant.json +1 -17
- homeassistant/const.py +1 -1
- homeassistant/generated/integrations.json +1 -8
- homeassistant/package_constraints.txt +1 -1
- {homeassistant-2025.7.0b1.dist-info → homeassistant-2025.7.0b3.dist-info}/METADATA +1 -1
- {homeassistant-2025.7.0b1.dist-info → homeassistant-2025.7.0b3.dist-info}/RECORD +277 -275
- homeassistant/components/dweet/__init__.py +0 -79
- homeassistant/components/dweet/manifest.json +0 -10
- homeassistant/components/dweet/sensor.py +0 -124
- homeassistant/components/thermopro/translations/ga.json +0 -9
- homeassistant/components/thermopro/translations/mk.json +0 -9
- {homeassistant-2025.7.0b1.dist-info → homeassistant-2025.7.0b3.dist-info}/WHEEL +0 -0
- {homeassistant-2025.7.0b1.dist-info → homeassistant-2025.7.0b3.dist-info}/entry_points.txt +0 -0
- {homeassistant-2025.7.0b1.dist-info → homeassistant-2025.7.0b3.dist-info}/licenses/LICENSE.md +0 -0
- {homeassistant-2025.7.0b1.dist-info → homeassistant-2025.7.0b3.dist-info}/licenses/homeassistant/backports/LICENSE.Python +0 -0
- {homeassistant-2025.7.0b1.dist-info → homeassistant-2025.7.0b3.dist-info}/top_level.txt +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"""Support for sending data to Dweet.io."""
|
|
2
|
-
|
|
3
|
-
from datetime import timedelta
|
|
4
|
-
import logging
|
|
5
|
-
|
|
6
|
-
import dweepy
|
|
7
|
-
import voluptuous as vol
|
|
8
|
-
|
|
9
|
-
from homeassistant.const import (
|
|
10
|
-
ATTR_FRIENDLY_NAME,
|
|
11
|
-
CONF_NAME,
|
|
12
|
-
CONF_WHITELIST,
|
|
13
|
-
EVENT_STATE_CHANGED,
|
|
14
|
-
STATE_UNKNOWN,
|
|
15
|
-
)
|
|
16
|
-
from homeassistant.core import HomeAssistant
|
|
17
|
-
from homeassistant.helpers import config_validation as cv, state as state_helper
|
|
18
|
-
from homeassistant.helpers.typing import ConfigType
|
|
19
|
-
from homeassistant.util import Throttle
|
|
20
|
-
|
|
21
|
-
_LOGGER = logging.getLogger(__name__)
|
|
22
|
-
|
|
23
|
-
DOMAIN = "dweet"
|
|
24
|
-
|
|
25
|
-
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=1)
|
|
26
|
-
|
|
27
|
-
CONFIG_SCHEMA = vol.Schema(
|
|
28
|
-
{
|
|
29
|
-
DOMAIN: vol.Schema(
|
|
30
|
-
{
|
|
31
|
-
vol.Required(CONF_NAME): cv.string,
|
|
32
|
-
vol.Required(CONF_WHITELIST, default=[]): vol.All(
|
|
33
|
-
cv.ensure_list, [cv.entity_id]
|
|
34
|
-
),
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
},
|
|
38
|
-
extra=vol.ALLOW_EXTRA,
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|
43
|
-
"""Set up the Dweet.io component."""
|
|
44
|
-
conf = config[DOMAIN]
|
|
45
|
-
name = conf.get(CONF_NAME)
|
|
46
|
-
whitelist = conf.get(CONF_WHITELIST)
|
|
47
|
-
json_body = {}
|
|
48
|
-
|
|
49
|
-
def dweet_event_listener(event):
|
|
50
|
-
"""Listen for new messages on the bus and sends them to Dweet.io."""
|
|
51
|
-
state = event.data.get("new_state")
|
|
52
|
-
if (
|
|
53
|
-
state is None
|
|
54
|
-
or state.state in (STATE_UNKNOWN, "")
|
|
55
|
-
or state.entity_id not in whitelist
|
|
56
|
-
):
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
try:
|
|
60
|
-
_state = state_helper.state_as_number(state)
|
|
61
|
-
except ValueError:
|
|
62
|
-
_state = state.state
|
|
63
|
-
|
|
64
|
-
json_body[state.attributes.get(ATTR_FRIENDLY_NAME)] = _state
|
|
65
|
-
|
|
66
|
-
send_data(name, json_body)
|
|
67
|
-
|
|
68
|
-
hass.bus.listen(EVENT_STATE_CHANGED, dweet_event_listener)
|
|
69
|
-
|
|
70
|
-
return True
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
|
74
|
-
def send_data(name, msg):
|
|
75
|
-
"""Send the collected data to Dweet.io."""
|
|
76
|
-
try:
|
|
77
|
-
dweepy.dweet_for(name, msg)
|
|
78
|
-
except dweepy.DweepyError:
|
|
79
|
-
_LOGGER.error("Error saving data to Dweet.io: %s", msg)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"domain": "dweet",
|
|
3
|
-
"name": "dweet.io",
|
|
4
|
-
"codeowners": [],
|
|
5
|
-
"documentation": "https://www.home-assistant.io/integrations/dweet",
|
|
6
|
-
"iot_class": "cloud_polling",
|
|
7
|
-
"loggers": ["dweepy"],
|
|
8
|
-
"quality_scale": "legacy",
|
|
9
|
-
"requirements": ["dweepy==0.3.0"]
|
|
10
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"""Support for showing values from Dweet.io."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from datetime import timedelta
|
|
6
|
-
import json
|
|
7
|
-
import logging
|
|
8
|
-
|
|
9
|
-
import dweepy
|
|
10
|
-
import voluptuous as vol
|
|
11
|
-
|
|
12
|
-
from homeassistant.components.sensor import (
|
|
13
|
-
PLATFORM_SCHEMA as SENSOR_PLATFORM_SCHEMA,
|
|
14
|
-
SensorEntity,
|
|
15
|
-
)
|
|
16
|
-
from homeassistant.const import (
|
|
17
|
-
CONF_DEVICE,
|
|
18
|
-
CONF_NAME,
|
|
19
|
-
CONF_UNIT_OF_MEASUREMENT,
|
|
20
|
-
CONF_VALUE_TEMPLATE,
|
|
21
|
-
)
|
|
22
|
-
from homeassistant.core import HomeAssistant
|
|
23
|
-
from homeassistant.helpers import config_validation as cv
|
|
24
|
-
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
|
25
|
-
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
|
26
|
-
|
|
27
|
-
_LOGGER = logging.getLogger(__name__)
|
|
28
|
-
|
|
29
|
-
DEFAULT_NAME = "Dweet.io Sensor"
|
|
30
|
-
|
|
31
|
-
SCAN_INTERVAL = timedelta(minutes=1)
|
|
32
|
-
|
|
33
|
-
PLATFORM_SCHEMA = SENSOR_PLATFORM_SCHEMA.extend(
|
|
34
|
-
{
|
|
35
|
-
vol.Required(CONF_DEVICE): cv.string,
|
|
36
|
-
vol.Required(CONF_VALUE_TEMPLATE): cv.template,
|
|
37
|
-
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
|
38
|
-
vol.Optional(CONF_UNIT_OF_MEASUREMENT): cv.string,
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def setup_platform(
|
|
44
|
-
hass: HomeAssistant,
|
|
45
|
-
config: ConfigType,
|
|
46
|
-
add_entities: AddEntitiesCallback,
|
|
47
|
-
discovery_info: DiscoveryInfoType | None = None,
|
|
48
|
-
) -> None:
|
|
49
|
-
"""Set up the Dweet sensor."""
|
|
50
|
-
name = config.get(CONF_NAME)
|
|
51
|
-
device = config.get(CONF_DEVICE)
|
|
52
|
-
value_template = config.get(CONF_VALUE_TEMPLATE)
|
|
53
|
-
unit = config.get(CONF_UNIT_OF_MEASUREMENT)
|
|
54
|
-
|
|
55
|
-
try:
|
|
56
|
-
content = json.dumps(dweepy.get_latest_dweet_for(device)[0]["content"])
|
|
57
|
-
except dweepy.DweepyError:
|
|
58
|
-
_LOGGER.error("Device/thing %s could not be found", device)
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
if value_template and value_template.render_with_possible_json_value(content) == "":
|
|
62
|
-
_LOGGER.error("%s was not found", value_template)
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
dweet = DweetData(device)
|
|
66
|
-
|
|
67
|
-
add_entities([DweetSensor(hass, dweet, name, value_template, unit)], True)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
class DweetSensor(SensorEntity):
|
|
71
|
-
"""Representation of a Dweet sensor."""
|
|
72
|
-
|
|
73
|
-
def __init__(self, hass, dweet, name, value_template, unit_of_measurement):
|
|
74
|
-
"""Initialize the sensor."""
|
|
75
|
-
self.hass = hass
|
|
76
|
-
self.dweet = dweet
|
|
77
|
-
self._name = name
|
|
78
|
-
self._value_template = value_template
|
|
79
|
-
self._state = None
|
|
80
|
-
self._unit_of_measurement = unit_of_measurement
|
|
81
|
-
|
|
82
|
-
@property
|
|
83
|
-
def name(self):
|
|
84
|
-
"""Return the name of the sensor."""
|
|
85
|
-
return self._name
|
|
86
|
-
|
|
87
|
-
@property
|
|
88
|
-
def native_unit_of_measurement(self):
|
|
89
|
-
"""Return the unit the value is expressed in."""
|
|
90
|
-
return self._unit_of_measurement
|
|
91
|
-
|
|
92
|
-
@property
|
|
93
|
-
def native_value(self):
|
|
94
|
-
"""Return the state."""
|
|
95
|
-
return self._state
|
|
96
|
-
|
|
97
|
-
def update(self) -> None:
|
|
98
|
-
"""Get the latest data from REST API."""
|
|
99
|
-
self.dweet.update()
|
|
100
|
-
|
|
101
|
-
if self.dweet.data is None:
|
|
102
|
-
self._state = None
|
|
103
|
-
else:
|
|
104
|
-
values = json.dumps(self.dweet.data[0]["content"])
|
|
105
|
-
self._state = self._value_template.render_with_possible_json_value(
|
|
106
|
-
values, None
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
class DweetData:
|
|
111
|
-
"""The class for handling the data retrieval."""
|
|
112
|
-
|
|
113
|
-
def __init__(self, device):
|
|
114
|
-
"""Initialize the sensor."""
|
|
115
|
-
self._device = device
|
|
116
|
-
self.data = None
|
|
117
|
-
|
|
118
|
-
def update(self):
|
|
119
|
-
"""Get the latest data from Dweet.io."""
|
|
120
|
-
try:
|
|
121
|
-
self.data = dweepy.get_latest_dweet_for(self._device)
|
|
122
|
-
except dweepy.DweepyError:
|
|
123
|
-
_LOGGER.warning("Device %s doesn't contain any data", self._device)
|
|
124
|
-
self.data = None
|
|
File without changes
|
|
File without changes
|
{homeassistant-2025.7.0b1.dist-info → homeassistant-2025.7.0b3.dist-info}/licenses/LICENSE.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|