homeassistant 2025.7.0b2__py3-none-any.whl → 2025.7.0b4__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.
Files changed (283) hide show
  1. homeassistant/components/ai_task/translations/fr.json +22 -1
  2. homeassistant/components/ai_task/translations/hu.json +22 -0
  3. homeassistant/components/ai_task/translations/it.json +22 -0
  4. homeassistant/components/alexa_devices/manifest.json +1 -1
  5. homeassistant/components/alexa_devices/translations/hu.json +4 -1
  6. homeassistant/components/alexa_devices/translations/it.json +29 -0
  7. homeassistant/components/alexa_devices/translations/pt.json +12 -1
  8. homeassistant/components/altruist/translations/hu.json +19 -0
  9. homeassistant/components/anthropic/translations/fr.json +37 -0
  10. homeassistant/components/anthropic/translations/hu.json +19 -0
  11. homeassistant/components/anthropic/translations/it.json +37 -0
  12. homeassistant/components/assist_satellite/translations/fr.json +8 -0
  13. homeassistant/components/assist_satellite/translations/hu.json +38 -0
  14. homeassistant/components/assist_satellite/translations/it.json +8 -0
  15. homeassistant/components/blue_current/translations/el.json +3 -1
  16. homeassistant/components/bluetooth/translations/el.json +3 -0
  17. homeassistant/components/denonavr/translations/el.json +5 -0
  18. homeassistant/components/derivative/translations/fr.json +4 -0
  19. homeassistant/components/derivative/translations/it.json +4 -0
  20. homeassistant/components/devolo_home_control/translations/hu.json +21 -0
  21. homeassistant/components/devolo_home_control/translations/it.json +6 -0
  22. homeassistant/components/dsmr/sensor.py +8 -0
  23. homeassistant/components/ecovacs/translations/el.json +1 -0
  24. homeassistant/components/electric_kiwi/translations/hu.json +6 -0
  25. homeassistant/components/emoncms/translations/el.json +3 -0
  26. homeassistant/components/enphase_envoy/translations/hu.json +18 -0
  27. homeassistant/components/ezviz/translations/it.json +10 -0
  28. homeassistant/components/fitbit/translations/hu.json +6 -0
  29. homeassistant/components/fronius/translations/el.json +14 -1
  30. homeassistant/components/frontend/manifest.json +1 -1
  31. homeassistant/components/geocaching/translations/hu.json +6 -0
  32. homeassistant/components/google/translations/hu.json +6 -0
  33. homeassistant/components/google_assistant_sdk/translations/hu.json +6 -0
  34. homeassistant/components/google_drive/translations/hu.json +6 -0
  35. homeassistant/components/google_generative_ai_conversation/translations/fr.json +82 -1
  36. homeassistant/components/google_generative_ai_conversation/translations/hu.json +68 -0
  37. homeassistant/components/google_generative_ai_conversation/translations/it.json +20 -0
  38. homeassistant/components/google_generative_ai_conversation/translations/pt.json +28 -0
  39. homeassistant/components/google_mail/translations/hu.json +6 -0
  40. homeassistant/components/google_photos/translations/hu.json +6 -0
  41. homeassistant/components/google_sheets/translations/hu.json +6 -0
  42. homeassistant/components/google_tasks/translations/hu.json +6 -0
  43. homeassistant/components/home_connect/translations/hu.json +6 -0
  44. homeassistant/components/homeassistant/translations/fr.json +1 -0
  45. homeassistant/components/homeassistant/translations/it.json +1 -0
  46. homeassistant/components/homeassistant_hardware/translations/el.json +1 -0
  47. homeassistant/components/homeassistant_hardware/translations/es.json +1 -0
  48. homeassistant/components/homeassistant_hardware/translations/et.json +1 -0
  49. homeassistant/components/homeassistant_hardware/translations/fr.json +4 -0
  50. homeassistant/components/homeassistant_hardware/translations/it.json +6 -0
  51. homeassistant/components/homeassistant_hardware/translations/pt.json +1 -0
  52. homeassistant/components/homeassistant_hardware/translations/sk.json +1 -0
  53. homeassistant/components/homeassistant_hardware/translations/sv.json +1 -0
  54. homeassistant/components/homeassistant_hardware/translations/zh-Hans.json +1 -0
  55. homeassistant/components/homeassistant_hardware/translations/zh-Hant.json +1 -0
  56. homeassistant/components/homeassistant_sky_connect/translations/el.json +2 -0
  57. homeassistant/components/homeassistant_sky_connect/translations/es.json +2 -0
  58. homeassistant/components/homeassistant_sky_connect/translations/et.json +2 -0
  59. homeassistant/components/homeassistant_sky_connect/translations/fr.json +4 -0
  60. homeassistant/components/homeassistant_sky_connect/translations/it.json +4 -0
  61. homeassistant/components/homeassistant_sky_connect/translations/pt.json +2 -0
  62. homeassistant/components/homeassistant_sky_connect/translations/sk.json +2 -0
  63. homeassistant/components/homeassistant_sky_connect/translations/sv.json +2 -0
  64. homeassistant/components/homeassistant_sky_connect/translations/zh-Hans.json +2 -0
  65. homeassistant/components/homeassistant_sky_connect/translations/zh-Hant.json +2 -0
  66. homeassistant/components/homeassistant_yellow/translations/el.json +2 -0
  67. homeassistant/components/homeassistant_yellow/translations/es.json +2 -0
  68. homeassistant/components/homeassistant_yellow/translations/et.json +2 -0
  69. homeassistant/components/homeassistant_yellow/translations/fr.json +2 -0
  70. homeassistant/components/homeassistant_yellow/translations/hu.json +1 -0
  71. homeassistant/components/homeassistant_yellow/translations/it.json +2 -0
  72. homeassistant/components/homeassistant_yellow/translations/pt.json +2 -0
  73. homeassistant/components/homeassistant_yellow/translations/sk.json +2 -0
  74. homeassistant/components/homeassistant_yellow/translations/sv.json +1 -0
  75. homeassistant/components/homeassistant_yellow/translations/zh-Hans.json +2 -0
  76. homeassistant/components/homeassistant_yellow/translations/zh-Hant.json +2 -0
  77. homeassistant/components/homee/translations/hu.json +25 -0
  78. homeassistant/components/homewizard/translations/sv.json +1 -1
  79. homeassistant/components/honeywell/manifest.json +1 -1
  80. homeassistant/components/husqvarna_automower/button.py +3 -1
  81. homeassistant/components/husqvarna_automower/translations/hu.json +6 -0
  82. homeassistant/components/imap/translations/fr.json +2 -0
  83. homeassistant/components/iotty/translations/hu.json +6 -0
  84. homeassistant/components/jellyfin/client_wrapper.py +1 -2
  85. homeassistant/components/jellyfin/coordinator.py +3 -0
  86. homeassistant/components/jellyfin/manifest.json +1 -2
  87. homeassistant/components/keenetic_ndms2/translations/hu.json +3 -0
  88. homeassistant/components/lametric/translations/hu.json +6 -0
  89. homeassistant/components/lifx/translations/el.json +2 -1
  90. homeassistant/components/litterrobot/translations/hu.json +3 -0
  91. homeassistant/components/litterrobot/translations/it.json +4 -0
  92. homeassistant/components/lyric/translations/hu.json +6 -0
  93. homeassistant/components/matter/translations/hu.json +10 -0
  94. homeassistant/components/mcp/translations/hu.json +6 -0
  95. homeassistant/components/microbees/translations/hu.json +6 -0
  96. homeassistant/components/miele/translations/hu.json +28 -1
  97. homeassistant/components/monzo/translations/hu.json +6 -0
  98. homeassistant/components/mqtt/config_flow.py +34 -7
  99. homeassistant/components/mqtt/strings.json +11 -4
  100. homeassistant/components/mqtt/translations/bg.json +1 -3
  101. homeassistant/components/mqtt/translations/cs.json +2 -6
  102. homeassistant/components/mqtt/translations/de.json +23 -16
  103. homeassistant/components/mqtt/translations/el.json +11 -0
  104. homeassistant/components/mqtt/translations/en-GB.json +2 -6
  105. homeassistant/components/mqtt/translations/en.json +13 -6
  106. homeassistant/components/mqtt/translations/es.json +2 -6
  107. homeassistant/components/mqtt/translations/et.json +13 -6
  108. homeassistant/components/mqtt/translations/fr.json +27 -6
  109. homeassistant/components/mqtt/translations/fy.json +2 -5
  110. homeassistant/components/mqtt/translations/ga.json +2 -6
  111. homeassistant/components/mqtt/translations/he.json +2 -6
  112. homeassistant/components/mqtt/translations/hu.json +2 -6
  113. homeassistant/components/mqtt/translations/it.json +25 -0
  114. homeassistant/components/mqtt/translations/ja.json +1 -4
  115. homeassistant/components/mqtt/translations/lt.json +2 -6
  116. homeassistant/components/mqtt/translations/mk.json +1 -6
  117. homeassistant/components/mqtt/translations/nl.json +27 -6
  118. homeassistant/components/mqtt/translations/pt.json +4 -6
  119. homeassistant/components/mqtt/translations/ru.json +2 -6
  120. homeassistant/components/mqtt/translations/sk.json +13 -6
  121. homeassistant/components/mqtt/translations/sl.json +2 -6
  122. homeassistant/components/mqtt/translations/sv.json +2 -6
  123. homeassistant/components/mqtt/translations/tr.json +2 -6
  124. homeassistant/components/mqtt/translations/zh-Hans.json +2 -6
  125. homeassistant/components/mqtt/translations/zh-Hant.json +13 -6
  126. homeassistant/components/myuplink/translations/hu.json +6 -0
  127. homeassistant/components/neato/translations/hu.json +6 -0
  128. homeassistant/components/nest/translations/hu.json +6 -0
  129. homeassistant/components/netatmo/translations/hu.json +6 -0
  130. homeassistant/components/nextdns/translations/fr.json +6 -0
  131. homeassistant/components/ntfy/translations/hu.json +112 -2
  132. homeassistant/components/nut/translations/el.json +42 -0
  133. homeassistant/components/ollama/translations/fr.json +33 -0
  134. homeassistant/components/ollama/translations/hu.json +33 -0
  135. homeassistant/components/ollama/translations/it.json +35 -0
  136. homeassistant/components/ondilo_ico/translations/hu.json +6 -0
  137. homeassistant/components/onedrive/translations/hu.json +6 -0
  138. homeassistant/components/onewire/translations/sv.json +1 -1
  139. homeassistant/components/openai_conversation/translations/fr.json +56 -0
  140. homeassistant/components/openai_conversation/translations/hu.json +56 -0
  141. homeassistant/components/openai_conversation/translations/it.json +56 -0
  142. homeassistant/components/paperless_ngx/manifest.json +1 -1
  143. homeassistant/components/paperless_ngx/translations/hu.json +4 -2
  144. homeassistant/components/peblar/translations/el.json +12 -0
  145. homeassistant/components/pegel_online/translations/bg.json +1 -2
  146. homeassistant/components/pegel_online/translations/ca.json +1 -2
  147. homeassistant/components/pegel_online/translations/cs.json +1 -2
  148. homeassistant/components/pegel_online/translations/de.json +1 -1
  149. homeassistant/components/pegel_online/translations/el.json +1 -1
  150. homeassistant/components/pegel_online/translations/en-GB.json +1 -2
  151. homeassistant/components/pegel_online/translations/en.json +1 -1
  152. homeassistant/components/pegel_online/translations/es.json +1 -1
  153. homeassistant/components/pegel_online/translations/et.json +1 -1
  154. homeassistant/components/pegel_online/translations/fi.json +1 -2
  155. homeassistant/components/pegel_online/translations/fr.json +1 -2
  156. homeassistant/components/pegel_online/translations/hu.json +1 -2
  157. homeassistant/components/pegel_online/translations/id.json +1 -2
  158. homeassistant/components/pegel_online/translations/it.json +1 -2
  159. homeassistant/components/pegel_online/translations/ja.json +1 -2
  160. homeassistant/components/pegel_online/translations/ko.json +1 -2
  161. homeassistant/components/pegel_online/translations/lt.json +1 -2
  162. homeassistant/components/pegel_online/translations/lv.json +1 -2
  163. homeassistant/components/pegel_online/translations/nl.json +1 -2
  164. homeassistant/components/pegel_online/translations/pt.json +1 -2
  165. homeassistant/components/pegel_online/translations/ru.json +1 -2
  166. homeassistant/components/pegel_online/translations/sk.json +1 -1
  167. homeassistant/components/pegel_online/translations/sv.json +1 -2
  168. homeassistant/components/pegel_online/translations/tr.json +1 -2
  169. homeassistant/components/pegel_online/translations/zh-Hant.json +1 -1
  170. homeassistant/components/pi_hole/translations/fr.json +1 -0
  171. homeassistant/components/playstation_network/translations/fr.json +15 -0
  172. homeassistant/components/playstation_network/translations/hu.json +73 -0
  173. homeassistant/components/playstation_network/translations/it.json +43 -0
  174. homeassistant/components/point/translations/hu.json +6 -0
  175. homeassistant/components/rest/data.py +40 -1
  176. homeassistant/components/screenlogic/translations/el.json +7 -0
  177. homeassistant/components/sensibo/translations/el.json +1 -0
  178. homeassistant/components/senz/translations/hu.json +6 -0
  179. homeassistant/components/shelly/entity.py +10 -3
  180. homeassistant/components/smappee/translations/hu.json +6 -0
  181. homeassistant/components/smartthings/translations/hu.json +6 -0
  182. homeassistant/components/sonos/translations/fr.json +6 -0
  183. homeassistant/components/sonos/translations/it.json +11 -0
  184. homeassistant/components/spotify/translations/hu.json +6 -0
  185. homeassistant/components/stream/__init__.py +8 -4
  186. homeassistant/components/stream/const.py +2 -1
  187. homeassistant/components/stream/core.py +3 -1
  188. homeassistant/components/subaru/translations/el.json +2 -0
  189. homeassistant/components/subaru/translations/en-GB.json +2 -0
  190. homeassistant/components/subaru/translations/es.json +2 -0
  191. homeassistant/components/subaru/translations/et.json +2 -0
  192. homeassistant/components/subaru/translations/pt.json +2 -0
  193. homeassistant/components/subaru/translations/sk.json +2 -0
  194. homeassistant/components/subaru/translations/zh-Hans.json +2 -0
  195. homeassistant/components/subaru/translations/zh-Hant.json +2 -0
  196. homeassistant/components/swiss_public_transport/translations/el.json +60 -6
  197. homeassistant/components/switchbot/translations/hu.json +19 -0
  198. homeassistant/components/switchbot/translations/it.json +53 -0
  199. homeassistant/components/switchbot_cloud/__init__.py +6 -1
  200. homeassistant/components/switchbot_cloud/binary_sensor.py +8 -1
  201. homeassistant/components/switchbot_cloud/sensor.py +3 -2
  202. homeassistant/components/telegram_bot/manifest.json +1 -1
  203. homeassistant/components/telegram_bot/translations/fr.json +3 -1
  204. homeassistant/components/telegram_bot/translations/hu.json +1 -0
  205. homeassistant/components/telegram_bot/translations/it.json +30 -0
  206. homeassistant/components/telegram_bot/translations/pt.json +30 -0
  207. homeassistant/components/tesla_fleet/translations/hu.json +7 -0
  208. homeassistant/components/teslemetry/coordinator.py +6 -6
  209. homeassistant/components/thermopro/strings.json +1 -1
  210. homeassistant/components/thermopro/translations/cs.json +0 -7
  211. homeassistant/components/thermopro/translations/de.json +1 -1
  212. homeassistant/components/thermopro/translations/el.json +1 -1
  213. homeassistant/components/thermopro/translations/en-GB.json +1 -1
  214. homeassistant/components/thermopro/translations/en.json +1 -1
  215. homeassistant/components/thermopro/translations/et.json +1 -1
  216. homeassistant/components/thermopro/translations/hu.json +0 -7
  217. homeassistant/components/thermopro/translations/ja.json +0 -7
  218. homeassistant/components/thermopro/translations/lt.json +0 -7
  219. homeassistant/components/thermopro/translations/nl.json +0 -7
  220. homeassistant/components/thermopro/translations/pt-BR.json +0 -7
  221. homeassistant/components/thermopro/translations/pt.json +0 -7
  222. homeassistant/components/thermopro/translations/ru.json +0 -7
  223. homeassistant/components/thermopro/translations/sk.json +1 -1
  224. homeassistant/components/thermopro/translations/sv.json +0 -7
  225. homeassistant/components/thermopro/translations/tr.json +0 -7
  226. homeassistant/components/tibber/manifest.json +1 -1
  227. homeassistant/components/tibber/sensor.py +1 -1
  228. homeassistant/components/tilt_pi/translations/hu.json +21 -0
  229. homeassistant/components/toon/translations/hu.json +6 -0
  230. homeassistant/components/vegehub/translations/hu.json +11 -0
  231. homeassistant/components/vegehub/translations/it.json +40 -0
  232. homeassistant/components/vulcan/manifest.json +1 -1
  233. homeassistant/components/weheat/translations/hu.json +6 -0
  234. homeassistant/components/withings/translations/hu.json +6 -0
  235. homeassistant/components/wled/translations/fr.json +1 -0
  236. homeassistant/components/wmspro/cover.py +2 -0
  237. homeassistant/components/xbox/translations/hu.json +6 -0
  238. homeassistant/components/xiaomi_miio/translations/fr.json +24 -2
  239. homeassistant/components/xiaomi_miio/translations/hu.json +7 -0
  240. homeassistant/components/yale/translations/hu.json +6 -0
  241. homeassistant/components/yolink/translations/hu.json +6 -0
  242. homeassistant/components/zha/translations/fr.json +50 -0
  243. homeassistant/components/zha/translations/hu.json +6 -0
  244. homeassistant/components/zha/translations/it.json +50 -0
  245. homeassistant/components/zha/translations/sv.json +4 -0
  246. homeassistant/components/zwave_js/config_flow.py +81 -28
  247. homeassistant/components/zwave_js/strings.json +30 -10
  248. homeassistant/components/zwave_js/translations/cs.json +0 -12
  249. homeassistant/components/zwave_js/translations/de.json +26 -6
  250. homeassistant/components/zwave_js/translations/el.json +25 -4
  251. homeassistant/components/zwave_js/translations/en-GB.json +0 -12
  252. homeassistant/components/zwave_js/translations/en.json +24 -4
  253. homeassistant/components/zwave_js/translations/es.json +24 -4
  254. homeassistant/components/zwave_js/translations/et.json +25 -4
  255. homeassistant/components/zwave_js/translations/fi.json +0 -14
  256. homeassistant/components/zwave_js/translations/fr.json +6 -0
  257. homeassistant/components/zwave_js/translations/ga.json +0 -14
  258. homeassistant/components/zwave_js/translations/hu.json +32 -4
  259. homeassistant/components/zwave_js/translations/it.json +26 -0
  260. homeassistant/components/zwave_js/translations/lt.json +0 -12
  261. homeassistant/components/zwave_js/translations/mk.json +0 -5
  262. homeassistant/components/zwave_js/translations/pt.json +10 -13
  263. homeassistant/components/zwave_js/translations/ru.json +0 -8
  264. homeassistant/components/zwave_js/translations/sk.json +25 -4
  265. homeassistant/components/zwave_js/translations/sv.json +0 -12
  266. homeassistant/components/zwave_js/translations/tr.json +0 -12
  267. homeassistant/components/zwave_js/translations/zh-Hans.json +27 -6
  268. homeassistant/components/zwave_js/translations/zh-Hant.json +24 -4
  269. homeassistant/const.py +1 -1
  270. homeassistant/generated/integrations.json +1 -8
  271. homeassistant/package_constraints.txt +1 -1
  272. {homeassistant-2025.7.0b2.dist-info → homeassistant-2025.7.0b4.dist-info}/METADATA +1 -1
  273. {homeassistant-2025.7.0b2.dist-info → homeassistant-2025.7.0b4.dist-info}/RECORD +278 -273
  274. homeassistant/components/dweet/__init__.py +0 -79
  275. homeassistant/components/dweet/manifest.json +0 -10
  276. homeassistant/components/dweet/sensor.py +0 -124
  277. homeassistant/components/thermopro/translations/ga.json +0 -9
  278. homeassistant/components/thermopro/translations/mk.json +0 -9
  279. {homeassistant-2025.7.0b2.dist-info → homeassistant-2025.7.0b4.dist-info}/WHEEL +0 -0
  280. {homeassistant-2025.7.0b2.dist-info → homeassistant-2025.7.0b4.dist-info}/entry_points.txt +0 -0
  281. {homeassistant-2025.7.0b2.dist-info → homeassistant-2025.7.0b4.dist-info}/licenses/LICENSE.md +0 -0
  282. {homeassistant-2025.7.0b2.dist-info → homeassistant-2025.7.0b4.dist-info}/licenses/homeassistant/backports/LICENSE.Python +0 -0
  283. {homeassistant-2025.7.0b2.dist-info → homeassistant-2025.7.0b4.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
@@ -1,9 +0,0 @@
1
- {
2
- "entity": {
3
- "button": {
4
- "set_datetime": {
5
- "name": "Socraigh D\u00e1ta Am"
6
- }
7
- }
8
- }
9
- }
@@ -1,9 +0,0 @@
1
- {
2
- "entity": {
3
- "button": {
4
- "set_datetime": {
5
- "name": "\u041f\u043e\u0441\u0442\u0430\u0432\u0435\u0442\u0435 \u0434\u0430\u0442\u0443\u043c \u0438 \u0432\u0440\u0435\u043c\u0435"
6
- }
7
- }
8
- }
9
- }