homeassistant-stubs 2024.4.4__py3-none-any.whl → 2024.5.0b0__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 (360) hide show
  1. homeassistant-stubs/auth/__init__.pyi +3 -1
  2. homeassistant-stubs/auth/jwt_wrapper.pyi +1 -1
  3. homeassistant-stubs/auth/permissions/__init__.pyi +1 -2
  4. homeassistant-stubs/auth/permissions/events.pyi +3 -2
  5. homeassistant-stubs/auth/session.pyi +46 -0
  6. homeassistant-stubs/backports/enum.pyi +6 -2
  7. homeassistant-stubs/backports/functools.pyi +5 -15
  8. homeassistant-stubs/block_async_io.pyi +8 -1
  9. homeassistant-stubs/bootstrap.pyi +7 -1
  10. homeassistant-stubs/components/accuweather/__init__.pyi +9 -13
  11. homeassistant-stubs/components/accuweather/config_flow.pyi +2 -10
  12. homeassistant-stubs/components/accuweather/const.pyi +2 -2
  13. homeassistant-stubs/components/accuweather/coordinator.pyi +27 -0
  14. homeassistant-stubs/components/accuweather/diagnostics.pyi +1 -1
  15. homeassistant-stubs/components/accuweather/sensor.pyi +29 -8
  16. homeassistant-stubs/components/accuweather/weather.pyi +9 -5
  17. homeassistant-stubs/components/adax/climate.pyi +3 -1
  18. homeassistant-stubs/components/adguard/__init__.pyi +9 -1
  19. homeassistant-stubs/components/adguard/const.pyi +0 -2
  20. homeassistant-stubs/components/adguard/entity.pyi +4 -3
  21. homeassistant-stubs/components/adguard/sensor.pyi +3 -3
  22. homeassistant-stubs/components/adguard/switch.pyi +3 -3
  23. homeassistant-stubs/components/airtouch5/config_flow.pyi +3 -3
  24. homeassistant-stubs/components/airzone_cloud/entity.pyi +7 -0
  25. homeassistant-stubs/components/airzone_cloud/select.pyi +38 -0
  26. homeassistant-stubs/components/airzone_cloud/water_heater.pyi +35 -0
  27. homeassistant-stubs/components/alert/__init__.pyi +2 -2
  28. homeassistant-stubs/components/alexa/config.pyi +2 -0
  29. homeassistant-stubs/components/alexa/entities.pyi +0 -2
  30. homeassistant-stubs/components/alexa/intent.pyi +2 -1
  31. homeassistant-stubs/components/alexa/resources.pyi +3 -3
  32. homeassistant-stubs/components/alexa/state_report.pyi +3 -4
  33. homeassistant-stubs/components/ambient_network/__init__.pyi +10 -0
  34. homeassistant-stubs/components/ambient_network/config_flow.pyi +22 -0
  35. homeassistant-stubs/components/ambient_network/const.pyi +12 -0
  36. homeassistant-stubs/components/ambient_network/coordinator.pyi +18 -0
  37. homeassistant-stubs/components/ambient_network/entity.pyi +20 -0
  38. homeassistant-stubs/components/ambient_network/helper.pyi +4 -0
  39. homeassistant-stubs/components/ambient_network/sensor.pyi +46 -0
  40. homeassistant-stubs/components/ambient_station/sensor.pyi +3 -1
  41. homeassistant-stubs/components/apache_kafka/__init__.pyi +1 -2
  42. homeassistant-stubs/components/apcupsd/binary_sensor.pyi +1 -0
  43. homeassistant-stubs/components/apcupsd/sensor.pyi +1 -0
  44. homeassistant-stubs/components/api/__init__.pyi +2 -2
  45. homeassistant-stubs/components/apple_tv/remote.pyi +1 -1
  46. homeassistant-stubs/components/arris_tg2492lg/device_tracker.pyi +5 -4
  47. homeassistant-stubs/components/assist_pipeline/__init__.pyi +2 -2
  48. homeassistant-stubs/components/assist_pipeline/const.pyi +1 -0
  49. homeassistant-stubs/components/assist_pipeline/pipeline.pyi +5 -3
  50. homeassistant-stubs/components/auth/__init__.pyi +9 -2
  51. homeassistant-stubs/components/auth/login_flow.pyi +2 -2
  52. homeassistant-stubs/components/auth/mfa_setup_flow.pyi +1 -1
  53. homeassistant-stubs/components/automation/__init__.pyi +7 -9
  54. homeassistant-stubs/components/automation/logbook.pyi +3 -1
  55. homeassistant-stubs/components/axis/hub/event_source.pyi +23 -0
  56. homeassistant-stubs/components/axis/hub/hub.pyi +4 -9
  57. homeassistant-stubs/components/baf/fan.pyi +1 -0
  58. homeassistant-stubs/components/bayesian/binary_sensor.pyi +2 -2
  59. homeassistant-stubs/components/bluetooth/config_flow.pyi +6 -0
  60. homeassistant-stubs/components/bluetooth/diagnostics.pyi +1 -1
  61. homeassistant-stubs/components/bluetooth/util.pyi +2 -1
  62. homeassistant-stubs/components/bmw_connected_drive/binary_sensor.pyi +2 -1
  63. homeassistant-stubs/components/bmw_connected_drive/const.pyi +1 -0
  64. homeassistant-stubs/components/bmw_connected_drive/sensor.pyi +4 -3
  65. homeassistant-stubs/components/camera/__init__.pyi +2 -2
  66. homeassistant-stubs/components/cloud/__init__.pyi +9 -4
  67. homeassistant-stubs/components/cloud/alexa_config.pyi +2 -2
  68. homeassistant-stubs/components/cloud/const.pyi +2 -1
  69. homeassistant-stubs/components/cloud/google_config.pyi +3 -3
  70. homeassistant-stubs/components/cloud/http_api.pyi +2 -2
  71. homeassistant-stubs/components/cloud/prefs.pyi +5 -3
  72. homeassistant-stubs/components/cloud/stt.pyi +1 -0
  73. homeassistant-stubs/components/cloud/tts.pyi +1 -0
  74. homeassistant-stubs/components/cloud/util.pyi +7 -0
  75. homeassistant-stubs/components/command_line/binary_sensor.pyi +4 -4
  76. homeassistant-stubs/components/command_line/const.pyi +4 -1
  77. homeassistant-stubs/components/command_line/cover.pyi +3 -3
  78. homeassistant-stubs/components/command_line/sensor.pyi +4 -5
  79. homeassistant-stubs/components/command_line/switch.pyi +3 -3
  80. homeassistant-stubs/components/config/__init__.pyi +1 -1
  81. homeassistant-stubs/components/deconz/binary_sensor.pyi +0 -1
  82. homeassistant-stubs/components/demo/notify.pyi +12 -10
  83. homeassistant-stubs/components/demo/sensor.pyi +1 -1
  84. homeassistant-stubs/components/derivative/sensor.pyi +2 -2
  85. homeassistant-stubs/components/device_tracker/config_entry.pyi +1 -1
  86. homeassistant-stubs/components/device_tracker/legacy.pyi +2 -1
  87. homeassistant-stubs/components/dhcp/__init__.pyi +2 -2
  88. homeassistant-stubs/components/dlna_dms/dms.pyi +2 -1
  89. homeassistant-stubs/components/ecovacs/event.pyi +1 -0
  90. homeassistant-stubs/components/ecovacs/select.pyi +1 -1
  91. homeassistant-stubs/components/ecovacs/util.pyi +5 -1
  92. homeassistant-stubs/components/ecovacs/vacuum.pyi +1 -0
  93. homeassistant-stubs/components/emulated_hue/config.pyi +2 -2
  94. homeassistant-stubs/components/emulated_hue/hue_api.pyi +2 -2
  95. homeassistant-stubs/components/energenie_power_sockets/__init__.pyi +12 -0
  96. homeassistant-stubs/components/energenie_power_sockets/config_flow.pyi +6 -0
  97. homeassistant-stubs/components/energenie_power_sockets/const.pyi +5 -0
  98. homeassistant-stubs/components/energenie_power_sockets/switch.pyi +27 -0
  99. homeassistant-stubs/components/energy/data.pyi +1 -0
  100. homeassistant-stubs/components/energy/sensor.pyi +4 -4
  101. homeassistant-stubs/components/energy/websocket_api.pyi +1 -1
  102. homeassistant-stubs/components/enigma2/__init__.pyi +11 -0
  103. homeassistant-stubs/components/enigma2/config_flow.pyi +17 -0
  104. homeassistant-stubs/components/enigma2/const.pyi +1 -0
  105. homeassistant-stubs/components/enigma2/media_player.pyi +9 -6
  106. homeassistant-stubs/components/enphase_envoy/coordinator.pyi +1 -0
  107. homeassistant-stubs/components/eq3btsmart/__init__.pyi +18 -0
  108. homeassistant-stubs/components/eq3btsmart/climate.pyi +55 -0
  109. homeassistant-stubs/components/eq3btsmart/config_flow.pyi +17 -0
  110. homeassistant-stubs/components/eq3btsmart/const.pyi +38 -0
  111. homeassistant-stubs/components/eq3btsmart/entity.pyi +10 -0
  112. homeassistant-stubs/components/eq3btsmart/models.pyi +20 -0
  113. homeassistant-stubs/components/eq3btsmart/schemas.pyi +6 -0
  114. homeassistant-stubs/components/esphome/datetime.pyi +14 -0
  115. homeassistant-stubs/components/esphome/entry_data.pyi +4 -5
  116. homeassistant-stubs/components/esphome/event.pyi +16 -0
  117. homeassistant-stubs/components/esphome/manager.pyi +5 -4
  118. homeassistant-stubs/components/esphome/update.pyi +0 -1
  119. homeassistant-stubs/components/esphome/valve.pyi +30 -0
  120. homeassistant-stubs/components/esphome/voice_assistant.pyi +24 -8
  121. homeassistant-stubs/components/filter/sensor.pyi +2 -2
  122. homeassistant-stubs/components/fritz/__init__.pyi +2 -2
  123. homeassistant-stubs/components/fritz/button.pyi +16 -3
  124. homeassistant-stubs/components/fritz/common.pyi +6 -3
  125. homeassistant-stubs/components/fritz/config_flow.pyi +7 -2
  126. homeassistant-stubs/components/fritz/const.pyi +5 -1
  127. homeassistant-stubs/components/fritzbox/climate.pyi +1 -1
  128. homeassistant-stubs/components/fritzbox/config_flow.pyi +2 -0
  129. homeassistant-stubs/components/fritzbox/coordinator.pyi +4 -2
  130. homeassistant-stubs/components/generic_hygrostat/humidifier.pyi +4 -2
  131. homeassistant-stubs/components/generic_thermostat/climate.pyi +2 -2
  132. homeassistant-stubs/components/geo_location/trigger.pyi +2 -2
  133. homeassistant-stubs/components/glances/coordinator.pyi +1 -0
  134. homeassistant-stubs/components/glances/sensor.pyi +6 -5
  135. homeassistant-stubs/components/group/entity.pyi +9 -13
  136. homeassistant-stubs/components/group/event.pyi +2 -2
  137. homeassistant-stubs/components/group/media_player.pyi +2 -2
  138. homeassistant-stubs/components/group/notify.pyi +2 -1
  139. homeassistant-stubs/components/group/registry.pyi +7 -4
  140. homeassistant-stubs/components/history/websocket_api.pyi +6 -6
  141. homeassistant-stubs/components/history_stats/coordinator.pyi +2 -2
  142. homeassistant-stubs/components/history_stats/data.pyi +1 -2
  143. homeassistant-stubs/components/homeassistant/logbook.pyi +5 -3
  144. homeassistant-stubs/components/homeassistant/triggers/numeric_state.pyi +2 -2
  145. homeassistant-stubs/components/homeassistant/triggers/state.pyi +2 -2
  146. homeassistant-stubs/components/homeassistant/triggers/time.pyi +2 -2
  147. homeassistant-stubs/components/homeassistant_alerts/__init__.pyi +3 -1
  148. homeassistant-stubs/components/homeassistant_sky_connect/__init__.pyi +7 -9
  149. homeassistant-stubs/components/homeassistant_sky_connect/config_flow.pyi +60 -6
  150. homeassistant-stubs/components/homeassistant_sky_connect/const.pyi +8 -0
  151. homeassistant-stubs/components/homeassistant_sky_connect/util.pyi +23 -2
  152. homeassistant-stubs/components/homekit/accessories.pyi +2 -2
  153. homeassistant-stubs/components/homekit/type_cameras.pyi +3 -2
  154. homeassistant-stubs/components/homekit/type_covers.pyi +2 -2
  155. homeassistant-stubs/components/homekit/type_humidifiers.pyi +2 -2
  156. homeassistant-stubs/components/homekit/type_thermostats.pyi +2 -2
  157. homeassistant-stubs/components/homekit/util.pyi +3 -4
  158. homeassistant-stubs/components/homeworks/__init__.pyi +7 -2
  159. homeassistant-stubs/components/homeworks/button.pyi +1 -1
  160. homeassistant-stubs/components/http/__init__.pyi +11 -7
  161. homeassistant-stubs/components/http/auth.pyi +11 -3
  162. homeassistant-stubs/components/http/const.pyi +7 -0
  163. homeassistant-stubs/components/http/session.pyi +29 -0
  164. homeassistant-stubs/components/hydrawise/__init__.pyi +3 -6
  165. homeassistant-stubs/components/hydrawise/binary_sensor.pyi +1 -4
  166. homeassistant-stubs/components/hydrawise/config_flow.pyi +8 -9
  167. homeassistant-stubs/components/hydrawise/sensor.pyi +2 -4
  168. homeassistant-stubs/components/hydrawise/switch.pyi +2 -5
  169. homeassistant-stubs/components/image/__init__.pyi +2 -2
  170. homeassistant-stubs/components/imap/__init__.pyi +20 -4
  171. homeassistant-stubs/components/imap/config_flow.pyi +2 -1
  172. homeassistant-stubs/components/imap/const.pyi +5 -2
  173. homeassistant-stubs/components/imap/coordinator.pyi +5 -2
  174. homeassistant-stubs/components/integration/sensor.pyi +12 -13
  175. homeassistant-stubs/components/islamic_prayer_times/config_flow.pyi +1 -3
  176. homeassistant-stubs/components/islamic_prayer_times/coordinator.pyi +2 -2
  177. homeassistant-stubs/components/isy994/helpers.pyi +1 -1
  178. homeassistant-stubs/components/jvc_projector/select.pyi +30 -0
  179. homeassistant-stubs/components/knx/expose.pyi +2 -2
  180. homeassistant-stubs/components/knx/helpers/__init__.pyi +0 -0
  181. homeassistant-stubs/components/knx/notify.pyi +16 -3
  182. homeassistant-stubs/components/knx/repairs.pyi +7 -0
  183. homeassistant-stubs/components/logbook/__init__.pyi +1 -0
  184. homeassistant-stubs/components/logbook/helpers.pyi +5 -4
  185. homeassistant-stubs/components/logbook/models.pyi +4 -3
  186. homeassistant-stubs/components/logbook/processor.pyi +3 -2
  187. homeassistant-stubs/components/logger/helpers.pyi +4 -1
  188. homeassistant-stubs/components/media_extractor/__init__.pyi +4 -4
  189. homeassistant-stubs/components/media_extractor/const.pyi +5 -0
  190. homeassistant-stubs/components/min_max/sensor.pyi +2 -2
  191. homeassistant-stubs/components/minecraft_server/sensor.pyi +2 -2
  192. homeassistant-stubs/components/modbus/__init__.pyi +2 -2
  193. homeassistant-stubs/components/modbus/base_platform.pyi +1 -1
  194. homeassistant-stubs/components/modbus/climate.pyi +9 -3
  195. homeassistant-stubs/components/modbus/const.pyi +7 -0
  196. homeassistant-stubs/components/modbus/modbus.pyi +1 -0
  197. homeassistant-stubs/components/modbus/validators.pyi +2 -1
  198. homeassistant-stubs/components/mqtt/__init__.pyi +1 -2
  199. homeassistant-stubs/components/mqtt/client.pyi +30 -9
  200. homeassistant-stubs/components/mqtt/config_flow.pyi +9 -1
  201. homeassistant-stubs/components/mqtt/mixins.pyi +7 -4
  202. homeassistant-stubs/components/mqtt/models.pyi +1 -1
  203. homeassistant-stubs/components/mqtt/notify.pyi +31 -0
  204. homeassistant-stubs/components/netatmo/__init__.pyi +2 -0
  205. homeassistant-stubs/components/netatmo/binary_sensor.pyi +20 -0
  206. homeassistant-stubs/components/netatmo/camera.pyi +8 -11
  207. homeassistant-stubs/components/netatmo/climate.pyi +11 -19
  208. homeassistant-stubs/components/netatmo/cover.pyi +5 -7
  209. homeassistant-stubs/components/netatmo/entity.pyi +40 -10
  210. homeassistant-stubs/components/netatmo/fan.pyi +5 -8
  211. homeassistant-stubs/components/netatmo/light.pyi +11 -19
  212. homeassistant-stubs/components/netatmo/select.pyi +4 -7
  213. homeassistant-stubs/components/netatmo/sensor.pyi +36 -49
  214. homeassistant-stubs/components/netatmo/switch.pyi +5 -7
  215. homeassistant-stubs/components/nextdns/__init__.pyi +1 -38
  216. homeassistant-stubs/components/nextdns/binary_sensor.pyi +1 -1
  217. homeassistant-stubs/components/nextdns/button.pyi +1 -1
  218. homeassistant-stubs/components/nextdns/coordinator.pyi +42 -0
  219. homeassistant-stubs/components/nextdns/sensor.pyi +1 -1
  220. homeassistant-stubs/components/nextdns/switch.pyi +1 -1
  221. homeassistant-stubs/components/nfandroidtv/notify.pyi +2 -1
  222. homeassistant-stubs/components/notify/__init__.pyi +31 -2
  223. homeassistant-stubs/components/notify/const.pyi +2 -0
  224. homeassistant-stubs/components/number/const.pyi +1 -0
  225. homeassistant-stubs/components/number/significant_change.pyi +1 -1
  226. homeassistant-stubs/components/oncue/__init__.pyi +2 -1
  227. homeassistant-stubs/components/oncue/config_flow.pyi +7 -1
  228. homeassistant-stubs/components/open_meteo/weather.pyi +2 -1
  229. homeassistant-stubs/components/prometheus/__init__.pyi +1 -2
  230. homeassistant-stubs/components/proximity/__init__.pyi +1 -1
  231. homeassistant-stubs/components/proximity/coordinator.pyi +2 -2
  232. homeassistant-stubs/components/purpleair/config_flow.pyi +2 -2
  233. homeassistant-stubs/components/rabbitair/config_flow.pyi +4 -4
  234. homeassistant-stubs/components/recorder/__init__.pyi +1 -0
  235. homeassistant-stubs/components/recorder/auto_repairs/states/__init__.pyi +0 -0
  236. homeassistant-stubs/components/recorder/core.pyi +6 -5
  237. homeassistant-stubs/components/recorder/db_schema.pyi +3 -3
  238. homeassistant-stubs/components/recorder/history/__init__.pyi +5 -6
  239. homeassistant-stubs/components/recorder/history/legacy.pyi +7 -7
  240. homeassistant-stubs/components/recorder/history/modern.pyi +7 -7
  241. homeassistant-stubs/components/recorder/models/event.pyi +4 -1
  242. homeassistant-stubs/components/recorder/pool.pyi +1 -1
  243. homeassistant-stubs/components/recorder/services.pyi +1 -0
  244. homeassistant-stubs/components/recorder/statistics.pyi +4 -4
  245. homeassistant-stubs/components/recorder/table_managers/__init__.pyi +4 -3
  246. homeassistant-stubs/components/recorder/table_managers/event_types.pyi +5 -3
  247. homeassistant-stubs/components/recorder/table_managers/state_attributes.pyi +3 -3
  248. homeassistant-stubs/components/recorder/table_managers/states_meta.pyi +2 -2
  249. homeassistant-stubs/components/recorder/table_managers/statistics_meta.pyi +3 -3
  250. homeassistant-stubs/components/recorder/tasks.pyi +2 -1
  251. homeassistant-stubs/components/recorder/websocket_api.pyi +1 -1
  252. homeassistant-stubs/components/rest/__init__.pyi +2 -2
  253. homeassistant-stubs/components/rest/const.pyi +1 -0
  254. homeassistant-stubs/components/rest/data.pyi +1 -0
  255. homeassistant-stubs/components/rest/schema.pyi +1 -1
  256. homeassistant-stubs/components/rfxtrx/__init__.pyi +1 -1
  257. homeassistant-stubs/components/rfxtrx/config_flow.pyi +2 -2
  258. homeassistant-stubs/components/ring/__init__.pyi +25 -0
  259. homeassistant-stubs/components/ring/binary_sensor.pyi +35 -0
  260. homeassistant-stubs/components/ring/button.pyi +20 -0
  261. homeassistant-stubs/components/ring/camera.pyi +43 -0
  262. homeassistant-stubs/components/ring/config_flow.pyi +26 -0
  263. homeassistant-stubs/components/ring/const.pyi +12 -0
  264. homeassistant-stubs/components/ring/coordinator.pyi +25 -0
  265. homeassistant-stubs/components/ring/diagnostics.pyi +11 -0
  266. homeassistant-stubs/components/ring/entity.pyi +33 -0
  267. homeassistant-stubs/components/ring/light.pyi +34 -0
  268. homeassistant-stubs/components/ring/sensor.pyi +39 -0
  269. homeassistant-stubs/components/ring/siren.pyi +23 -0
  270. homeassistant-stubs/components/ring/switch.pyi +31 -0
  271. homeassistant-stubs/components/romy/binary_sensor.pyi +19 -0
  272. homeassistant-stubs/components/romy/config_flow.pyi +7 -7
  273. homeassistant-stubs/components/romy/sensor.pyi +20 -0
  274. homeassistant-stubs/components/sensor/__init__.pyi +1 -1
  275. homeassistant-stubs/components/sensor/significant_change.pyi +1 -1
  276. homeassistant-stubs/components/shelly/__init__.pyi +2 -4
  277. homeassistant-stubs/components/shelly/coordinator.pyi +8 -7
  278. homeassistant-stubs/components/starlink/coordinator.pyi +1 -0
  279. homeassistant-stubs/components/statistics/sensor.pyi +2 -2
  280. homeassistant-stubs/components/switch/light.pyi +2 -2
  281. homeassistant-stubs/components/synology_dsm/__init__.pyi +2 -2
  282. homeassistant-stubs/components/synology_dsm/camera.pyi +3 -2
  283. homeassistant-stubs/components/synology_dsm/common.pyi +6 -2
  284. homeassistant-stubs/components/synology_dsm/coordinator.pyi +4 -4
  285. homeassistant-stubs/components/synology_dsm/diagnostics.pyi +0 -1
  286. homeassistant-stubs/components/system_log/__init__.pyi +3 -3
  287. homeassistant-stubs/components/threshold/binary_sensor.pyi +2 -2
  288. homeassistant-stubs/components/tibber/sensor.pyi +1 -0
  289. homeassistant-stubs/components/tplink/coordinator.pyi +2 -0
  290. homeassistant-stubs/components/tplink/entity.pyi +1 -0
  291. homeassistant-stubs/components/tplink/light.pyi +1 -1
  292. homeassistant-stubs/components/tplink/sensor.pyi +4 -3
  293. homeassistant-stubs/components/tplink_omada/switch.pyi +12 -14
  294. homeassistant-stubs/components/trend/binary_sensor.pyi +2 -2
  295. homeassistant-stubs/components/unifi/__init__.pyi +2 -0
  296. homeassistant-stubs/components/unifi/button.pyi +2 -1
  297. homeassistant-stubs/components/unifi/hub/entity_helper.pyi +44 -0
  298. homeassistant-stubs/components/unifi/hub/hub.pyi +8 -13
  299. homeassistant-stubs/components/unifi/sensor.pyi +2 -1
  300. homeassistant-stubs/components/velbus/cover.pyi +2 -0
  301. homeassistant-stubs/components/weather/significant_change.pyi +1 -1
  302. homeassistant-stubs/components/websocket_api/commands.pyi +2 -2
  303. homeassistant-stubs/components/websocket_api/messages.pyi +1 -2
  304. homeassistant-stubs/components/websocket_api/sensor.pyi +3 -7
  305. homeassistant-stubs/components/withings/__init__.pyi +2 -8
  306. homeassistant-stubs/components/withings/config_flow.pyi +1 -1
  307. homeassistant-stubs/components/withings/const.pyi +0 -2
  308. homeassistant-stubs/components/zone/__init__.pyi +8 -10
  309. homeassistant-stubs/components/zone/trigger.pyi +2 -2
  310. homeassistant-stubs/components/zwave_js/config_flow.pyi +1 -1
  311. homeassistant-stubs/config.pyi +1 -1
  312. homeassistant-stubs/config_entries.pyi +32 -29
  313. homeassistant-stubs/const.pyi +11 -6
  314. homeassistant-stubs/core.pyi +56 -24
  315. homeassistant-stubs/data_entry_flow.pyi +3 -3
  316. homeassistant-stubs/exceptions.pyi +4 -2
  317. homeassistant-stubs/helpers/aiohttp_client.pyi +1 -0
  318. homeassistant-stubs/helpers/area_registry.pyi +28 -6
  319. homeassistant-stubs/helpers/backports/__init__.pyi +0 -0
  320. homeassistant-stubs/helpers/backports/aiohttp_resolver.pyi +21 -0
  321. homeassistant-stubs/helpers/category_registry.pyi +16 -6
  322. homeassistant-stubs/helpers/data_entry_flow.pyi +1 -1
  323. homeassistant-stubs/helpers/deprecation.pyi +5 -0
  324. homeassistant-stubs/helpers/device_registry.pyi +25 -12
  325. homeassistant-stubs/helpers/dispatcher.pyi +1 -1
  326. homeassistant-stubs/helpers/entity.pyi +6 -3
  327. homeassistant-stubs/helpers/entity_registry.pyi +24 -16
  328. homeassistant-stubs/helpers/event.pyi +10 -17
  329. homeassistant-stubs/helpers/floor_registry.pyi +14 -3
  330. homeassistant-stubs/helpers/frame.pyi +2 -2
  331. homeassistant-stubs/helpers/httpx_client.pyi +1 -1
  332. homeassistant-stubs/helpers/icon.pyi +3 -2
  333. homeassistant-stubs/helpers/intent.pyi +1 -2
  334. homeassistant-stubs/helpers/label_registry.pyi +14 -3
  335. homeassistant-stubs/helpers/network.pyi +2 -2
  336. homeassistant-stubs/helpers/normalized_name_base_registry.pyi +4 -6
  337. homeassistant-stubs/helpers/registry.pyi +19 -4
  338. homeassistant-stubs/helpers/reload.pyi +1 -1
  339. homeassistant-stubs/helpers/schema_config_entry_flow.pyi +2 -2
  340. homeassistant-stubs/helpers/service.pyi +4 -1
  341. homeassistant-stubs/helpers/significant_change.pyi +4 -4
  342. homeassistant-stubs/helpers/start.pyi +3 -1
  343. homeassistant-stubs/helpers/template.pyi +6 -3
  344. homeassistant-stubs/helpers/translation.pyi +5 -9
  345. homeassistant-stubs/helpers/typing.pyi +11 -7
  346. homeassistant-stubs/requirements.pyi +2 -0
  347. homeassistant-stubs/setup.pyi +1 -0
  348. homeassistant-stubs/util/async_.pyi +1 -6
  349. homeassistant-stubs/util/dt.pyi +5 -4
  350. homeassistant-stubs/util/event_type.pyi +14 -0
  351. homeassistant-stubs/util/logging.pyi +3 -4
  352. homeassistant-stubs/util/loop.pyi +15 -0
  353. homeassistant-stubs/util/signal_type.pyi +1 -1
  354. homeassistant-stubs/util/timeout.pyi +6 -6
  355. homeassistant-stubs/util/yaml/loader.pyi +3 -4
  356. homeassistant-stubs/util/yaml/objects.pyi +12 -2
  357. {homeassistant_stubs-2024.4.4.dist-info → homeassistant_stubs-2024.5.0b0.dist-info}/METADATA +2 -2
  358. {homeassistant_stubs-2024.4.4.dist-info → homeassistant_stubs-2024.5.0b0.dist-info}/RECORD +360 -303
  359. {homeassistant_stubs-2024.4.4.dist-info → homeassistant_stubs-2024.5.0b0.dist-info}/LICENSE +0 -0
  360. {homeassistant_stubs-2024.4.4.dist-info → homeassistant_stubs-2024.5.0b0.dist-info}/WHEEL +0 -0
@@ -7,14 +7,27 @@ from _typeshed import Incomplete
7
7
  from collections.abc import Iterable
8
8
  from homeassistant.core import HomeAssistant as HomeAssistant, callback as callback
9
9
  from homeassistant.util import slugify as slugify
10
+ from homeassistant.util.event_type import EventType as EventType
10
11
  from typing import Any, Literal, TypedDict
11
12
 
12
13
  DATA_REGISTRY: str
13
- EVENT_AREA_REGISTRY_UPDATED: str
14
+ EVENT_AREA_REGISTRY_UPDATED: EventType[EventAreaRegistryUpdatedData]
14
15
  STORAGE_KEY: str
15
16
  STORAGE_VERSION_MAJOR: int
16
17
  STORAGE_VERSION_MINOR: int
17
18
 
19
+ class _AreaStoreData(TypedDict):
20
+ aliases: list[str]
21
+ floor_id: str | None
22
+ icon: str | None
23
+ id: str
24
+ labels: list[str]
25
+ name: str
26
+ picture: str | None
27
+
28
+ class AreasRegistryStoreData(TypedDict):
29
+ areas: list[_AreaStoreData]
30
+
18
31
  class EventAreaRegistryUpdatedData(TypedDict):
19
32
  action: Literal['create', 'remove', 'update']
20
33
  area_id: str
@@ -29,11 +42,20 @@ class AreaEntry(NormalizedNameBaseRegistryEntry):
29
42
  picture: str | None
30
43
  def __init__(self, *, name, normalized_name, aliases, floor_id, icon, id, labels, picture) -> None: ...
31
44
 
32
- class AreaRegistryStore(Store[dict[str, list[dict[str, Any]]]]):
33
- async def _async_migrate_func(self, old_major_version: int, old_minor_version: int, old_data: dict[str, list[dict[str, Any]]]) -> dict[str, Any]: ...
45
+ class AreaRegistryStore(Store[AreasRegistryStoreData]):
46
+ async def _async_migrate_func(self, old_major_version: int, old_minor_version: int, old_data: dict[str, list[dict[str, Any]]]) -> AreasRegistryStoreData: ...
47
+
48
+ class AreaRegistryItems(NormalizedNameBaseRegistryItems[AreaEntry]):
49
+ _labels_index: Incomplete
50
+ _floors_index: Incomplete
51
+ def __init__(self) -> None: ...
52
+ def _index_entry(self, key: str, entry: AreaEntry) -> None: ...
53
+ def _unindex_entry(self, key: str, replacement_entry: AreaEntry | None = None) -> None: ...
54
+ def get_areas_for_label(self, label: str) -> list[AreaEntry]: ...
55
+ def get_areas_for_floor(self, floor: str) -> list[AreaEntry]: ...
34
56
 
35
- class AreaRegistry(BaseRegistry):
36
- areas: NormalizedNameBaseRegistryItems[AreaEntry]
57
+ class AreaRegistry(BaseRegistry[AreasRegistryStoreData]):
58
+ areas: AreaRegistryItems
37
59
  _area_data: dict[str, AreaEntry]
38
60
  hass: Incomplete
39
61
  _store: Incomplete
@@ -47,7 +69,7 @@ class AreaRegistry(BaseRegistry):
47
69
  def async_update(self, area_id: str, *, aliases: set[str] | UndefinedType = ..., floor_id: str | None | UndefinedType = ..., icon: str | None | UndefinedType = ..., labels: set[str] | UndefinedType = ..., name: str | UndefinedType = ..., picture: str | None | UndefinedType = ...) -> AreaEntry: ...
48
70
  def _async_update(self, area_id: str, *, aliases: set[str] | UndefinedType = ..., floor_id: str | None | UndefinedType = ..., icon: str | None | UndefinedType = ..., labels: set[str] | UndefinedType = ..., name: str | UndefinedType = ..., picture: str | None | UndefinedType = ...) -> AreaEntry: ...
49
71
  async def async_load(self) -> None: ...
50
- def _data_to_save(self) -> dict[str, list[dict[str, Any]]]: ...
72
+ def _data_to_save(self) -> AreasRegistryStoreData: ...
51
73
  def _generate_area_id(self, name: str) -> str: ...
52
74
  def _async_setup_cleanup(self) -> None: ...
53
75
 
File without changes
@@ -0,0 +1,21 @@
1
+ from _typeshed import Incomplete
2
+ from aiohttp.abc import AbstractResolver
3
+ from typing import Any, TypedDict
4
+
5
+ _NUMERIC_SOCKET_FLAGS: Incomplete
6
+ _SUPPORTS_SCOPE_ID: Incomplete
7
+
8
+ class ResolveResult(TypedDict):
9
+ hostname: str
10
+ host: str
11
+ port: int
12
+ family: int
13
+ proto: int
14
+ flags: int
15
+
16
+ class AsyncResolver(AbstractResolver):
17
+ _loop: Incomplete
18
+ _resolver: Incomplete
19
+ def __init__(self, *args: Any, **kwargs: Any) -> None: ...
20
+ async def resolve(self, host: str, port: int = 0, family: int = ...) -> list[ResolveResult]: ...
21
+ async def close(self) -> None: ...
@@ -1,22 +1,32 @@
1
1
  from .registry import BaseRegistry as BaseRegistry
2
- from .typing import EventType as EventType, UNDEFINED as UNDEFINED, UndefinedType as UndefinedType
2
+ from .storage import Store as Store
3
+ from .typing import UNDEFINED as UNDEFINED, UndefinedType as UndefinedType
3
4
  from _typeshed import Incomplete
4
5
  from collections.abc import Iterable
5
6
  from dataclasses import dataclass
6
- from homeassistant.core import HomeAssistant as HomeAssistant, callback as callback
7
+ from homeassistant.core import Event as Event, HomeAssistant as HomeAssistant, callback as callback
8
+ from homeassistant.util.event_type import EventType as EventType
7
9
  from homeassistant.util.ulid import ulid_now as ulid_now
8
10
  from typing import Literal, TypedDict
9
11
 
10
12
  DATA_REGISTRY: str
11
- EVENT_CATEGORY_REGISTRY_UPDATED: str
13
+ EVENT_CATEGORY_REGISTRY_UPDATED: EventType[EventCategoryRegistryUpdatedData]
12
14
  STORAGE_KEY: str
13
15
  STORAGE_VERSION_MAJOR: int
14
16
 
17
+ class _CategoryStoreData(TypedDict):
18
+ category_id: str
19
+ icon: str | None
20
+ name: str
21
+
22
+ class CategoryRegistryStoreData(TypedDict):
23
+ categories: dict[str, list[_CategoryStoreData]]
24
+
15
25
  class EventCategoryRegistryUpdatedData(TypedDict):
16
26
  action: Literal['create', 'remove', 'update']
17
27
  scope: str
18
28
  category_id: str
19
- EventCategoryRegistryUpdated = EventType[EventCategoryRegistryUpdatedData]
29
+ EventCategoryRegistryUpdated = Event[EventCategoryRegistryUpdatedData]
20
30
 
21
31
  @dataclass(slots=True, kw_only=True, frozen=True)
22
32
  class CategoryEntry:
@@ -25,7 +35,7 @@ class CategoryEntry:
25
35
  name: str
26
36
  def __init__(self, *, category_id, icon, name) -> None: ...
27
37
 
28
- class CategoryRegistry(BaseRegistry):
38
+ class CategoryRegistry(BaseRegistry[CategoryRegistryStoreData]):
29
39
  hass: Incomplete
30
40
  categories: Incomplete
31
41
  _store: Incomplete
@@ -36,7 +46,7 @@ class CategoryRegistry(BaseRegistry):
36
46
  def async_delete(self, *, scope: str, category_id: str) -> None: ...
37
47
  def async_update(self, *, scope: str, category_id: str, icon: str | None | UndefinedType = ..., name: str | UndefinedType = ...) -> CategoryEntry: ...
38
48
  async def async_load(self) -> None: ...
39
- def _data_to_save(self) -> dict[str, dict[str, list[dict[str, str | None]]]]: ...
49
+ def _data_to_save(self) -> CategoryRegistryStoreData: ...
40
50
  def _async_ensure_name_is_available(self, scope: str, name: str, category_id: str | None = None) -> None: ...
41
51
 
42
52
  def async_get(hass: HomeAssistant) -> CategoryRegistry: ...
@@ -6,7 +6,7 @@ from homeassistant.components.http.data_validator import RequestDataValidator as
6
6
  from typing import Any, Generic
7
7
  from typing_extensions import TypeVar
8
8
 
9
- _FlowManagerT = TypeVar('_FlowManagerT', bound='data_entry_flow.FlowManager[Any]', default=data_entry_flow.FlowManager)
9
+ _FlowManagerT = TypeVar('_FlowManagerT', bound=data_entry_flow.FlowManager[Any], default=data_entry_flow.FlowManager)
10
10
 
11
11
  class _BaseFlowManagerView(HomeAssistantView, Generic[_FlowManagerT]):
12
12
  _flow_mgr: Incomplete
@@ -22,6 +22,11 @@ class DeprecatedConstantEnum(NamedTuple):
22
22
  enum: Enum
23
23
  breaks_in_ha_version: str | None
24
24
 
25
+ class DeprecatedAlias(NamedTuple):
26
+ value: Any
27
+ replacement: str
28
+ breaks_in_ha_version: str | None
29
+
25
30
  _PREFIX_DEPRECATED: str
26
31
 
27
32
  def check_if_deprecated_constant(name: str, module_globals: dict[str, Any]) -> Any: ...
@@ -3,25 +3,25 @@ from .debounce import Debouncer as Debouncer
3
3
  from .deprecation import DeprecatedConstantEnum as DeprecatedConstantEnum, all_with_deprecated_constants as all_with_deprecated_constants, check_if_deprecated_constant as check_if_deprecated_constant, dir_with_deprecated_constants as dir_with_deprecated_constants
4
4
  from .frame import report as report
5
5
  from .json import JSON_DUMP as JSON_DUMP, find_paths_unserializable_data as find_paths_unserializable_data, json_bytes as json_bytes, json_fragment as json_fragment
6
- from .registry import BaseRegistry as BaseRegistry
6
+ from .registry import BaseRegistry as BaseRegistry, BaseRegistryItems as BaseRegistryItems
7
7
  from .typing import UNDEFINED as UNDEFINED, UndefinedType as UndefinedType
8
8
  from _typeshed import Incomplete
9
- from collections import UserDict
10
- from collections.abc import Mapping, ValuesView
9
+ from collections.abc import Mapping
11
10
  from enum import StrEnum
12
- from homeassistant.backports.functools import cached_property as cached_property
11
+ from functools import cached_property as cached_property
13
12
  from homeassistant.config_entries import ConfigEntry as ConfigEntry
14
13
  from homeassistant.const import EVENT_HOMEASSISTANT_STARTED as EVENT_HOMEASSISTANT_STARTED, EVENT_HOMEASSISTANT_STOP as EVENT_HOMEASSISTANT_STOP
15
- from homeassistant.core import Event as Event, HomeAssistant as HomeAssistant, callback as callback, get_release_channel as get_release_channel
14
+ from homeassistant.core import Event as Event, HomeAssistant as HomeAssistant, ReleaseChannel as ReleaseChannel, callback as callback, get_release_channel as get_release_channel
16
15
  from homeassistant.exceptions import HomeAssistantError as HomeAssistantError
17
16
  from homeassistant.loader import async_suggest_report_issue as async_suggest_report_issue
17
+ from homeassistant.util.event_type import EventType as EventType
18
18
  from homeassistant.util.json import format_unserializable_data as format_unserializable_data
19
19
  from typing import Any, Literal, TypeVar, TypedDict
20
20
  from yarl import URL
21
21
 
22
22
  _LOGGER: Incomplete
23
23
  DATA_REGISTRY: str
24
- EVENT_DEVICE_REGISTRY_UPDATED: str
24
+ EVENT_DEVICE_REGISTRY_UPDATED: EventType[EventDeviceRegistryUpdatedData]
25
25
  STORAGE_KEY: str
26
26
  STORAGE_VERSION_MAJOR: int
27
27
  STORAGE_VERSION_MINOR: int
@@ -114,7 +114,9 @@ class DeviceEntry:
114
114
  def disabled(self) -> bool: ...
115
115
  @property
116
116
  def dict_repr(self) -> dict[str, Any]: ...
117
+ @cached_property
117
118
  def json_repr(self) -> bytes | None: ...
119
+ @cached_property
118
120
  def as_storage_fragment(self) -> json_fragment: ...
119
121
  def __init__(self, area_id, config_entries, configuration_url, connections, disabled_by, entry_type, hw_version, id, identifiers, labels, manufacturer, model, name_by_user, name, serial_number, suggested_area, sw_version, via_device_id, is_new) -> None: ...
120
122
  def __lt__(self, other): ...
@@ -129,6 +131,7 @@ class DeletedDeviceEntry:
129
131
  id: str
130
132
  orphaned_timestamp: float | None
131
133
  def to_device_entry(self, config_entry_id: str, connections: set[tuple[str, str]], identifiers: set[tuple[str, str]]) -> DeviceEntry: ...
134
+ @cached_property
132
135
  def as_storage_fragment(self) -> json_fragment: ...
133
136
  def __init__(self, config_entries, connections, identifiers, id, orphaned_timestamp) -> None: ...
134
137
  def __lt__(self, other): ...
@@ -142,17 +145,27 @@ class DeviceRegistryStore(storage.Store[dict[str, list[dict[str, Any]]]]):
142
145
  async def _async_migrate_func(self, old_major_version: int, old_minor_version: int, old_data: dict[str, list[dict[str, Any]]]) -> dict[str, Any]: ...
143
146
  _EntryTypeT = TypeVar('_EntryTypeT', DeviceEntry, DeletedDeviceEntry)
144
147
 
145
- class DeviceRegistryItems(UserDict[str, _EntryTypeT]):
148
+ class DeviceRegistryItems(BaseRegistryItems[_EntryTypeT]):
146
149
  _connections: Incomplete
147
150
  _identifiers: Incomplete
148
151
  def __init__(self) -> None: ...
149
- def values(self) -> ValuesView[_EntryTypeT]: ...
150
- def __setitem__(self, key: str, entry: _EntryTypeT) -> None: ...
151
- def __delitem__(self, key: str) -> None: ...
152
+ def _index_entry(self, key: str, entry: _EntryTypeT) -> None: ...
153
+ def _unindex_entry(self, key: str, replacement_entry: _EntryTypeT | None = None) -> None: ...
152
154
  def get_entry(self, identifiers: set[tuple[str, str]] | None, connections: set[tuple[str, str]] | None) -> _EntryTypeT | None: ...
153
155
 
154
- class DeviceRegistry(BaseRegistry):
155
- devices: DeviceRegistryItems[DeviceEntry]
156
+ class ActiveDeviceRegistryItems(DeviceRegistryItems[DeviceEntry]):
157
+ _area_id_index: Incomplete
158
+ _config_entry_id_index: Incomplete
159
+ _labels_index: Incomplete
160
+ def __init__(self) -> None: ...
161
+ def _index_entry(self, key: str, entry: DeviceEntry) -> None: ...
162
+ def _unindex_entry(self, key: str, replacement_entry: DeviceEntry | None = None) -> None: ...
163
+ def get_devices_for_area_id(self, area_id: str) -> list[DeviceEntry]: ...
164
+ def get_devices_for_label(self, label: str) -> list[DeviceEntry]: ...
165
+ def get_devices_for_config_entry_id(self, config_entry_id: str) -> list[DeviceEntry]: ...
166
+
167
+ class DeviceRegistry(BaseRegistry[dict[str, list[dict[str, Any]]]]):
168
+ devices: ActiveDeviceRegistryItems
156
169
  deleted_devices: DeviceRegistryItems[DeletedDeviceEntry]
157
170
  _device_data: dict[str, DeviceEntry]
158
171
  hass: Incomplete
@@ -1,6 +1,6 @@
1
1
  from _typeshed import Incomplete
2
2
  from collections.abc import Callable, Coroutine
3
- from homeassistant.core import HassJob as HassJob, HomeAssistant as HomeAssistant, callback as callback
3
+ from homeassistant.core import HassJob as HassJob, HomeAssistant as HomeAssistant, callback as callback, get_hassjob_callable_job_type as get_hassjob_callable_job_type
4
4
  from homeassistant.loader import bind_hass as bind_hass
5
5
  from homeassistant.util.async_ import run_callback_threadsafe as run_callback_threadsafe
6
6
  from homeassistant.util.logging import catch_log_exception as catch_log_exception
@@ -8,12 +8,12 @@ from .typing import StateType as StateType, UNDEFINED as UNDEFINED, UndefinedTyp
8
8
  from _typeshed import Incomplete
9
9
  from abc import ABCMeta
10
10
  from collections import deque
11
- from collections.abc import Callable as Callable, Coroutine, Iterable, Mapping, MutableMapping
11
+ from collections.abc import Callable as Callable, Coroutine, Iterable, Mapping
12
12
  from enum import Enum, IntFlag
13
13
  from functools import cached_property as cached_property
14
14
  from homeassistant.config import DATA_CUSTOMIZE as DATA_CUSTOMIZE
15
15
  from homeassistant.const import ATTR_ASSUMED_STATE as ATTR_ASSUMED_STATE, ATTR_ATTRIBUTION as ATTR_ATTRIBUTION, ATTR_DEVICE_CLASS as ATTR_DEVICE_CLASS, ATTR_ENTITY_PICTURE as ATTR_ENTITY_PICTURE, ATTR_FRIENDLY_NAME as ATTR_FRIENDLY_NAME, ATTR_ICON as ATTR_ICON, ATTR_SUPPORTED_FEATURES as ATTR_SUPPORTED_FEATURES, ATTR_UNIT_OF_MEASUREMENT as ATTR_UNIT_OF_MEASUREMENT, DEVICE_DEFAULT_NAME as DEVICE_DEFAULT_NAME, EntityCategory as EntityCategory, STATE_OFF as STATE_OFF, STATE_ON as STATE_ON, STATE_UNAVAILABLE as STATE_UNAVAILABLE, STATE_UNKNOWN as STATE_UNKNOWN
16
- from homeassistant.core import CALLBACK_TYPE as CALLBACK_TYPE, Context as Context, Event as Event, HassJobType as HassJobType, HomeAssistant as HomeAssistant, callback as callback, get_hassjob_callable_job_type as get_hassjob_callable_job_type, get_release_channel as get_release_channel
16
+ from homeassistant.core import CALLBACK_TYPE as CALLBACK_TYPE, Context as Context, Event as Event, HassJobType as HassJobType, HomeAssistant as HomeAssistant, ReleaseChannel as ReleaseChannel, callback as callback, get_hassjob_callable_job_type as get_hassjob_callable_job_type, get_release_channel as get_release_channel
17
17
  from homeassistant.exceptions import HomeAssistantError as HomeAssistantError, InvalidStateError as InvalidStateError, NoEntitySpecifiedError as NoEntitySpecifiedError
18
18
  from homeassistant.loader import async_suggest_report_issue as async_suggest_report_issue, bind_hass as bind_hass
19
19
  from homeassistant.util import ensure_unique_string as ensure_unique_string, slugify as slugify
@@ -111,6 +111,7 @@ class Entity(cached_properties=CACHED_PROPERTIES_WITH_ATTR_, metaclass=ABCCached
111
111
  __combined_unrecorded_attributes: frozenset[str]
112
112
  _job_types: dict[str, HassJobType] | None
113
113
  _state_info: StateInfo
114
+ _is_custom_component: bool
114
115
  __capabilities_updated_at: deque[float]
115
116
  __capabilities_updated_at_reported: bool
116
117
  __remove_future: asyncio.Future[None] | None
@@ -125,7 +126,7 @@ class Entity(cached_properties=CACHED_PROPERTIES_WITH_ATTR_, metaclass=ABCCached
125
126
  _attr_entity_picture: str | None
126
127
  _attr_entity_registry_enabled_default: bool
127
128
  _attr_entity_registry_visible_default: bool
128
- _attr_extra_state_attributes: MutableMapping[str, Any]
129
+ _attr_extra_state_attributes: dict[str, Any]
129
130
  _attr_force_update: bool
130
131
  _attr_icon: str | None
131
132
  _attr_name: str | None
@@ -203,6 +204,8 @@ class Entity(cached_properties=CACHED_PROPERTIES_WITH_ATTR_, metaclass=ABCCached
203
204
  def enabled(self) -> bool: ...
204
205
  def async_set_context(self, context: Context) -> None: ...
205
206
  async def async_update_ha_state(self, force_refresh: bool = False) -> None: ...
207
+ def _async_verify_state_writable(self) -> None: ...
208
+ def _async_write_ha_state_from_call_soon_threadsafe(self) -> None: ...
206
209
  def async_write_ha_state(self) -> None: ...
207
210
  def _stringify_state(self, available: bool) -> str: ...
208
211
  def _friendly_name_internal(self) -> str | None: ...
@@ -1,25 +1,26 @@
1
1
  from . import storage as storage
2
- from .device_registry import EVENT_DEVICE_REGISTRY_UPDATED as EVENT_DEVICE_REGISTRY_UPDATED
2
+ from .device_registry import EVENT_DEVICE_REGISTRY_UPDATED as EVENT_DEVICE_REGISTRY_UPDATED, EventDeviceRegistryUpdatedData as EventDeviceRegistryUpdatedData
3
3
  from .json import JSON_DUMP as JSON_DUMP, find_paths_unserializable_data as find_paths_unserializable_data, json_bytes as json_bytes, json_fragment as json_fragment
4
- from .registry import BaseRegistry as BaseRegistry
4
+ from .registry import BaseRegistry as BaseRegistry, BaseRegistryItems as BaseRegistryItems
5
5
  from .typing import UNDEFINED as UNDEFINED, UndefinedType as UndefinedType
6
6
  from _typeshed import Incomplete
7
- from collections import UserDict
8
- from collections.abc import Callable as Callable, Iterable, KeysView, Mapping, ValuesView
7
+ from collections.abc import Callable as Callable, Container, Hashable, KeysView, Mapping
9
8
  from enum import StrEnum
10
- from homeassistant.backports.functools import cached_property as cached_property
9
+ from functools import cached_property as cached_property
11
10
  from homeassistant.config_entries import ConfigEntry as ConfigEntry
12
11
  from homeassistant.const import ATTR_DEVICE_CLASS as ATTR_DEVICE_CLASS, ATTR_FRIENDLY_NAME as ATTR_FRIENDLY_NAME, ATTR_ICON as ATTR_ICON, ATTR_RESTORED as ATTR_RESTORED, ATTR_SUPPORTED_FEATURES as ATTR_SUPPORTED_FEATURES, ATTR_UNIT_OF_MEASUREMENT as ATTR_UNIT_OF_MEASUREMENT, EVENT_HOMEASSISTANT_START as EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP as EVENT_HOMEASSISTANT_STOP, EntityCategory as EntityCategory, MAX_LENGTH_STATE_DOMAIN as MAX_LENGTH_STATE_DOMAIN, MAX_LENGTH_STATE_ENTITY_ID as MAX_LENGTH_STATE_ENTITY_ID, Platform as Platform, STATE_UNAVAILABLE as STATE_UNAVAILABLE, STATE_UNKNOWN as STATE_UNKNOWN
13
12
  from homeassistant.core import Event as Event, HomeAssistant as HomeAssistant, callback as callback, split_entity_id as split_entity_id, valid_entity_id as valid_entity_id
14
13
  from homeassistant.exceptions import MaxLengthExceeded as MaxLengthExceeded
14
+ from homeassistant.loader import async_suggest_report_issue as async_suggest_report_issue
15
15
  from homeassistant.util import slugify as slugify
16
+ from homeassistant.util.event_type import EventType as EventType
16
17
  from homeassistant.util.json import format_unserializable_data as format_unserializable_data
17
18
  from homeassistant.util.read_only_dict import ReadOnlyDict as ReadOnlyDict
18
19
  from typing import Any, Literal, NotRequired, TypeVar, TypedDict
19
20
 
20
21
  T = TypeVar('T')
21
22
  DATA_REGISTRY: str
22
- EVENT_ENTITY_REGISTRY_UPDATED: str
23
+ EVENT_ENTITY_REGISTRY_UPDATED: EventType[EventEntityRegistryUpdatedData]
23
24
  _LOGGER: Incomplete
24
25
  STORAGE_VERSION_MAJOR: int
25
26
  STORAGE_VERSION_MINOR: int
@@ -93,10 +94,15 @@ class RegistryEntry:
93
94
  def hidden(self) -> bool: ...
94
95
  @property
95
96
  def _as_display_dict(self) -> dict[str, Any] | None: ...
97
+ @cached_property
96
98
  def display_json_repr(self) -> bytes | None: ...
99
+ @cached_property
97
100
  def as_partial_dict(self) -> dict[str, Any]: ...
101
+ @cached_property
98
102
  def extended_dict(self) -> dict[str, Any]: ...
103
+ @cached_property
99
104
  def partial_json_repr(self) -> bytes | None: ...
105
+ @cached_property
100
106
  def as_storage_fragment(self) -> json_fragment: ...
101
107
  def write_unavailable_state(self, hass: HomeAssistant) -> None: ...
102
108
  def __init__(self, entity_id, unique_id, platform, previous_unique_id, aliases, area_id, categories, capabilities, config_entry_id, device_class, device_id, domain, disabled_by, entity_category, hidden_by, icon, id, has_entity_name, labels, name, options, original_device_class, original_icon, original_name, supported_features, translation_key, unit_of_measurement) -> None: ...
@@ -114,6 +120,7 @@ class DeletedRegistryEntry:
114
120
  id: str
115
121
  orphaned_timestamp: float | None
116
122
  def _domain_default(self) -> str: ...
123
+ @cached_property
117
124
  def as_storage_fragment(self) -> json_fragment: ...
118
125
  def __init__(self, entity_id, unique_id, platform, config_entry_id, domain, id, orphaned_timestamp) -> None: ...
119
126
  def __lt__(self, other): ...
@@ -124,24 +131,25 @@ class DeletedRegistryEntry:
124
131
  class EntityRegistryStore(storage.Store[dict[str, list[dict[str, Any]]]]):
125
132
  async def _async_migrate_func(self, old_major_version: int, old_minor_version: int, old_data: dict[str, list[dict[str, Any]]]) -> dict: ...
126
133
 
127
- class EntityRegistryItems(UserDict[str, RegistryEntry]):
134
+ class EntityRegistryItems(BaseRegistryItems[RegistryEntry]):
128
135
  _entry_ids: Incomplete
129
136
  _index: Incomplete
130
137
  _config_entry_id_index: Incomplete
131
138
  _device_id_index: Incomplete
132
139
  _area_id_index: Incomplete
140
+ _labels_index: Incomplete
133
141
  def __init__(self) -> None: ...
134
- def values(self) -> ValuesView[RegistryEntry]: ...
135
- def __setitem__(self, key: str, entry: RegistryEntry) -> None: ...
136
- def _unindex_entry_value(self, key: str, value: str, index: dict[str, dict[str, Literal[True]]]) -> None: ...
137
- def _unindex_entry(self, key: str) -> None: ...
138
- def __delitem__(self, key: str) -> None: ...
142
+ def _index_entry(self, key: str, entry: RegistryEntry) -> None: ...
143
+ def _unindex_entry(self, key: str, replacement_entry: RegistryEntry | None = None) -> None: ...
139
144
  def get_device_ids(self) -> KeysView[str]: ...
140
145
  def get_entity_id(self, key: tuple[str, str, str]) -> str | None: ...
141
146
  def get_entry(self, key: str) -> RegistryEntry | None: ...
142
147
  def get_entries_for_device_id(self, device_id: str, include_disabled_entities: bool = False) -> list[RegistryEntry]: ...
143
148
  def get_entries_for_config_entry_id(self, config_entry_id: str) -> list[RegistryEntry]: ...
144
149
  def get_entries_for_area_id(self, area_id: str) -> list[RegistryEntry]: ...
150
+ def get_entries_for_label(self, label: str) -> list[RegistryEntry]: ...
151
+
152
+ def _validate_item(hass: HomeAssistant, domain: str, platform: str, unique_id: str | Hashable | UndefinedType | Any, *, disabled_by: RegistryEntryDisabler | None | UndefinedType = None, entity_category: EntityCategory | None | UndefinedType = None, hidden_by: RegistryEntryHider | None | UndefinedType = None) -> None: ...
145
153
 
146
154
  class EntityRegistry(BaseRegistry):
147
155
  deleted_entities: dict[tuple[str, str, str], DeletedRegistryEntry]
@@ -154,11 +162,11 @@ class EntityRegistry(BaseRegistry):
154
162
  def async_get(self, entity_id_or_uuid: str) -> RegistryEntry | None: ...
155
163
  def async_get_entity_id(self, domain: str, platform: str, unique_id: str) -> str | None: ...
156
164
  def async_device_ids(self) -> list[str]: ...
157
- def _entity_id_available(self, entity_id: str, known_object_ids: Iterable[str] | None) -> bool: ...
158
- def async_generate_entity_id(self, domain: str, suggested_object_id: str, known_object_ids: Iterable[str] | None = None) -> str: ...
159
- def async_get_or_create(self, domain: str, platform: str, unique_id: str, *, known_object_ids: Iterable[str] | None = None, suggested_object_id: str | None = None, disabled_by: RegistryEntryDisabler | None = None, hidden_by: RegistryEntryHider | None = None, get_initial_options: Callable[[], EntityOptionsType | None] | None = None, capabilities: Mapping[str, Any] | None | UndefinedType = ..., config_entry: ConfigEntry | None | UndefinedType = ..., device_id: str | None | UndefinedType = ..., entity_category: EntityCategory | UndefinedType | None = ..., has_entity_name: bool | UndefinedType = ..., original_device_class: str | None | UndefinedType = ..., original_icon: str | None | UndefinedType = ..., original_name: str | None | UndefinedType = ..., supported_features: int | None | UndefinedType = ..., translation_key: str | None | UndefinedType = ..., unit_of_measurement: str | None | UndefinedType = ...) -> RegistryEntry: ...
165
+ def _entity_id_available(self, entity_id: str, known_object_ids: Container[str] | None) -> bool: ...
166
+ def async_generate_entity_id(self, domain: str, suggested_object_id: str, known_object_ids: Container[str] | None = None) -> str: ...
167
+ def async_get_or_create(self, domain: str, platform: str, unique_id: str, *, known_object_ids: Container[str] | None = None, suggested_object_id: str | None = None, disabled_by: RegistryEntryDisabler | None = None, hidden_by: RegistryEntryHider | None = None, get_initial_options: Callable[[], EntityOptionsType | None] | None = None, capabilities: Mapping[str, Any] | None | UndefinedType = ..., config_entry: ConfigEntry | None | UndefinedType = ..., device_id: str | None | UndefinedType = ..., entity_category: EntityCategory | UndefinedType | None = ..., has_entity_name: bool | UndefinedType = ..., original_device_class: str | None | UndefinedType = ..., original_icon: str | None | UndefinedType = ..., original_name: str | None | UndefinedType = ..., supported_features: int | None | UndefinedType = ..., translation_key: str | None | UndefinedType = ..., unit_of_measurement: str | None | UndefinedType = ...) -> RegistryEntry: ...
160
168
  def async_remove(self, entity_id: str) -> None: ...
161
- def async_device_modified(self, event: Event) -> None: ...
169
+ def async_device_modified(self, event: Event[EventDeviceRegistryUpdatedData]) -> None: ...
162
170
  def _async_update_entity(self, entity_id: str, *, aliases: set[str] | UndefinedType = ..., area_id: str | None | UndefinedType = ..., categories: dict[str, str] | UndefinedType = ..., capabilities: Mapping[str, Any] | None | UndefinedType = ..., config_entry_id: str | None | UndefinedType = ..., device_class: str | None | UndefinedType = ..., device_id: str | None | UndefinedType = ..., disabled_by: RegistryEntryDisabler | None | UndefinedType = ..., entity_category: EntityCategory | None | UndefinedType = ..., hidden_by: RegistryEntryHider | None | UndefinedType = ..., icon: str | None | UndefinedType = ..., has_entity_name: bool | UndefinedType = ..., labels: set[str] | UndefinedType = ..., name: str | None | UndefinedType = ..., new_entity_id: str | UndefinedType = ..., new_unique_id: str | UndefinedType = ..., options: EntityOptionsType | UndefinedType = ..., original_device_class: str | None | UndefinedType = ..., original_icon: str | None | UndefinedType = ..., original_name: str | None | UndefinedType = ..., platform: str | None | UndefinedType = ..., supported_features: int | UndefinedType = ..., translation_key: str | None | UndefinedType = ..., unit_of_measurement: str | None | UndefinedType = ...) -> RegistryEntry: ...
163
171
  def async_update_entity(self, entity_id: str, *, aliases: set[str] | UndefinedType = ..., area_id: str | None | UndefinedType = ..., categories: dict[str, str] | UndefinedType = ..., capabilities: Mapping[str, Any] | None | UndefinedType = ..., config_entry_id: str | None | UndefinedType = ..., device_class: str | None | UndefinedType = ..., device_id: str | None | UndefinedType = ..., disabled_by: RegistryEntryDisabler | None | UndefinedType = ..., entity_category: EntityCategory | None | UndefinedType = ..., hidden_by: RegistryEntryHider | None | UndefinedType = ..., icon: str | None | UndefinedType = ..., has_entity_name: bool | UndefinedType = ..., labels: set[str] | UndefinedType = ..., name: str | None | UndefinedType = ..., new_entity_id: str | UndefinedType = ..., new_unique_id: str | UndefinedType = ..., original_device_class: str | None | UndefinedType = ..., original_icon: str | None | UndefinedType = ..., original_name: str | None | UndefinedType = ..., supported_features: int | UndefinedType = ..., translation_key: str | None | UndefinedType = ..., unit_of_measurement: str | None | UndefinedType = ...) -> RegistryEntry: ...
164
172
  def async_update_entity_platform(self, entity_id: str, new_platform: str, *, new_config_entry_id: str | UndefinedType = ..., new_unique_id: str | UndefinedType = ..., new_device_id: str | None | UndefinedType = ...) -> RegistryEntry: ...
@@ -1,5 +1,6 @@
1
1
  import asyncio
2
2
  import time
3
+ from . import frame as frame
3
4
  from .device_registry import EVENT_DEVICE_REGISTRY_UPDATED as EVENT_DEVICE_REGISTRY_UPDATED, EventDeviceRegistryUpdatedData as EventDeviceRegistryUpdatedData
4
5
  from .entity_registry import EVENT_ENTITY_REGISTRY_UPDATED as EVENT_ENTITY_REGISTRY_UPDATED, EventEntityRegistryUpdatedData as EventEntityRegistryUpdatedData
5
6
  from .ratelimit import KeyedRateLimit as KeyedRateLimit
@@ -11,11 +12,12 @@ from collections.abc import Callable, Coroutine, Iterable, Mapping, Sequence
11
12
  from dataclasses import dataclass
12
13
  from datetime import datetime, timedelta
13
14
  from homeassistant.const import EVENT_CORE_CONFIG_UPDATE as EVENT_CORE_CONFIG_UPDATE, EVENT_STATE_CHANGED as EVENT_STATE_CHANGED, MATCH_ALL as MATCH_ALL, SUN_EVENT_SUNRISE as SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET as SUN_EVENT_SUNSET
14
- from homeassistant.core import CALLBACK_TYPE as CALLBACK_TYPE, Event as Event, HassJob as HassJob, HassJobType as HassJobType, HomeAssistant as HomeAssistant, State as State, callback as callback, split_entity_id as split_entity_id
15
+ from homeassistant.core import CALLBACK_TYPE as CALLBACK_TYPE, Event as Event, EventStateChangedData as EventStateChangedData, HassJob as HassJob, HassJobType as HassJobType, HomeAssistant as HomeAssistant, State as State, callback as callback, split_entity_id as split_entity_id
15
16
  from homeassistant.exceptions import TemplateError as TemplateError
16
17
  from homeassistant.loader import bind_hass as bind_hass
17
18
  from homeassistant.util.async_ import run_callback_threadsafe as run_callback_threadsafe
18
- from typing import Any, Concatenate, Generic, ParamSpec, TypeVar, TypedDict
19
+ from homeassistant.util.event_type import EventType as EventType
20
+ from typing import Any, Concatenate, Generic, ParamSpec, TypeVar
19
21
 
20
22
  TRACK_STATE_CHANGE_CALLBACKS: str
21
23
  TRACK_STATE_CHANGE_LISTENER: str
@@ -40,11 +42,10 @@ _P = ParamSpec('_P')
40
42
  class _KeyedEventTracker(Generic[_TypedDictT]):
41
43
  listeners_key: str
42
44
  callbacks_key: str
43
- event_type: str
45
+ event_type: EventType[_TypedDictT] | str
44
46
  dispatcher_callable: Callable[[HomeAssistant, dict[str, list[HassJob[[Event[_TypedDictT]], Any]]], Event[_TypedDictT]], None]
45
47
  filter_callable: Callable[[HomeAssistant, dict[str, list[HassJob[[Event[_TypedDictT]], Any]]], _TypedDictT], bool]
46
- run_immediately: bool
47
- def __init__(self, listeners_key, callbacks_key, event_type, dispatcher_callable, filter_callable, run_immediately) -> None: ...
48
+ def __init__(self, listeners_key, callbacks_key, event_type, dispatcher_callable, filter_callable) -> None: ...
48
49
 
49
50
  @dataclass(slots=True)
50
51
  class TrackStates:
@@ -67,11 +68,6 @@ class TrackTemplateResult:
67
68
  result: Any
68
69
  def __init__(self, template, last_result, result) -> None: ...
69
70
 
70
- class EventStateChangedData(TypedDict):
71
- entity_id: str
72
- old_state: State | None
73
- new_state: State | None
74
-
75
71
  def threaded_listener_factory(async_factory: Callable[Concatenate[HomeAssistant, _P], Any]) -> Callable[Concatenate[HomeAssistant, _P], CALLBACK_TYPE]: ...
76
72
  def async_track_state_change(hass: HomeAssistant, entity_ids: str | Iterable[str], action: Callable[[str, State | None, State | None], Coroutine[Any, Any, None] | None], from_state: None | str | Iterable[str] = None, to_state: None | str | Iterable[str] = None) -> CALLBACK_TYPE: ...
77
73
 
@@ -213,23 +209,20 @@ def async_track_time_interval(hass: HomeAssistant, action: Callable[[datetime],
213
209
 
214
210
  track_time_interval: Incomplete
215
211
 
212
+ @dataclass(slots=True)
216
213
  class SunListener:
217
214
  hass: HomeAssistant
218
215
  job: HassJob[[], Coroutine[Any, Any, None] | None]
219
216
  event: str
220
217
  offset: timedelta | None
221
- _unsub_sun: CALLBACK_TYPE | None
222
- _unsub_config: CALLBACK_TYPE | None
218
+ _unsub_sun: CALLBACK_TYPE | None = ...
219
+ _unsub_config: CALLBACK_TYPE | None = ...
223
220
  def async_attach(self) -> None: ...
224
221
  def async_detach(self) -> None: ...
225
222
  def _listen_next_sun_event(self) -> None: ...
226
223
  def _handle_sun_event(self, _now: Any) -> None: ...
227
224
  def _handle_config_event(self, _event: Any) -> None: ...
228
- def __init__(self, hass, job, event, offset, unsub_sun, unsub_config) -> None: ...
229
- def __lt__(self, other): ...
230
- def __le__(self, other): ...
231
- def __gt__(self, other): ...
232
- def __ge__(self, other): ...
225
+ def __init__(self, hass, job, event, offset, _unsub_sun, _unsub_config) -> None: ...
233
226
 
234
227
  def async_track_sunrise(hass: HomeAssistant, action: Callable[[], None], offset: timedelta | None = None) -> CALLBACK_TYPE: ...
235
228
 
@@ -7,13 +7,24 @@ from collections.abc import Iterable
7
7
  from dataclasses import dataclass
8
8
  from homeassistant.core import Event as Event, HomeAssistant as HomeAssistant, callback as callback
9
9
  from homeassistant.util import slugify as slugify
10
+ from homeassistant.util.event_type import EventType as EventType
10
11
  from typing import Literal, TypedDict
11
12
 
12
13
  DATA_REGISTRY: str
13
- EVENT_FLOOR_REGISTRY_UPDATED: str
14
+ EVENT_FLOOR_REGISTRY_UPDATED: EventType[EventFloorRegistryUpdatedData]
14
15
  STORAGE_KEY: str
15
16
  STORAGE_VERSION_MAJOR: int
16
17
 
18
+ class _FloorStoreData(TypedDict):
19
+ aliases: list[str]
20
+ floor_id: str
21
+ icon: str | None
22
+ level: int | None
23
+ name: str
24
+
25
+ class FloorRegistryStoreData(TypedDict):
26
+ floors: list[_FloorStoreData]
27
+
17
28
  class EventFloorRegistryUpdatedData(TypedDict):
18
29
  action: Literal['create', 'remove', 'update']
19
30
  floor_id: str
@@ -27,7 +38,7 @@ class FloorEntry(NormalizedNameBaseRegistryEntry):
27
38
  level: int | None = ...
28
39
  def __init__(self, *, name, normalized_name, aliases, floor_id, icon, level) -> None: ...
29
40
 
30
- class FloorRegistry(BaseRegistry):
41
+ class FloorRegistry(BaseRegistry[FloorRegistryStoreData]):
31
42
  floors: NormalizedNameBaseRegistryItems[FloorEntry]
32
43
  _floor_data: dict[str, FloorEntry]
33
44
  hass: Incomplete
@@ -41,7 +52,7 @@ class FloorRegistry(BaseRegistry):
41
52
  def async_delete(self, floor_id: str) -> None: ...
42
53
  def async_update(self, floor_id: str, *, aliases: set[str] | UndefinedType = ..., icon: str | None | UndefinedType = ..., level: int | UndefinedType = ..., name: str | UndefinedType = ...) -> FloorEntry: ...
43
54
  async def async_load(self) -> None: ...
44
- def _data_to_save(self) -> dict[str, list[dict[str, str | int | list[str] | None]]]: ...
55
+ def _data_to_save(self) -> FloorRegistryStoreData: ...
45
56
 
46
57
  def async_get(hass: HomeAssistant) -> FloorRegistry: ...
47
58
  async def async_load(hass: HomeAssistant) -> None: ...
@@ -34,6 +34,6 @@ def get_integration_frame(exclude_integrations: set | None = None) -> Integratio
34
34
 
35
35
  class MissingIntegrationFrame(HomeAssistantError): ...
36
36
 
37
- def report(what: str, exclude_integrations: set | None = None, error_if_core: bool = True, level: int = ..., log_custom_component_only: bool = False) -> None: ...
38
- def _report_integration(what: str, integration_frame: IntegrationFrame, level: int = ...) -> None: ...
37
+ def report(what: str, exclude_integrations: set | None = None, error_if_core: bool = True, level: int = ..., log_custom_component_only: bool = False, error_if_integration: bool = False) -> None: ...
38
+ def _report_integration(what: str, integration_frame: IntegrationFrame, level: int = ..., error: bool = False) -> None: ...
39
39
  def warn_use(func: _CallableT, what: str) -> _CallableT: ...
@@ -20,7 +20,7 @@ def get_async_client(hass: HomeAssistant, verify_ssl: bool = True) -> httpx.Asyn
20
20
 
21
21
  class HassHttpXAsyncClient(httpx.AsyncClient):
22
22
  async def __aenter__(self) -> Self: ...
23
- async def __aexit__(self, *args: Any) -> None: ...
23
+ async def __aexit__(self, *args: object) -> None: ...
24
24
 
25
25
  def create_async_httpx_client(hass: HomeAssistant, verify_ssl: bool = True, auto_cleanup: bool = True, ssl_cipher_list: SSLCipherList = ..., **kwargs: Any) -> httpx.AsyncClient: ...
26
26
  def _async_register_async_client_shutdown(hass: HomeAssistant, client: httpx.AsyncClient, original_aclose: Callable[..., Any]) -> None: ...
@@ -1,3 +1,4 @@
1
+ import pathlib
1
2
  from .translation import build_resources as build_resources
2
3
  from _typeshed import Incomplete
3
4
  from collections.abc import Iterable
@@ -9,8 +10,8 @@ from typing import Any
9
10
  ICON_CACHE: str
10
11
  _LOGGER: Incomplete
11
12
 
12
- def _component_icons_path(component: str, integration: Integration) -> str | None: ...
13
- def _load_icons_files(icons_files: dict[str, str]) -> dict[str, dict[str, Any]]: ...
13
+ def _component_icons_path(integration: Integration) -> pathlib.Path: ...
14
+ def _load_icons_files(icons_files: dict[str, pathlib.Path]) -> dict[str, dict[str, Any]]: ...
14
15
  async def _async_get_component_icons(hass: HomeAssistant, components: set[str], integrations: dict[str, Integration]) -> dict[str, Any]: ...
15
16
 
16
17
  class _IconsCache:
@@ -13,11 +13,10 @@ from homeassistant.const import ATTR_DEVICE_CLASS as ATTR_DEVICE_CLASS, ATTR_ENT
13
13
  from homeassistant.core import Context as Context, HomeAssistant as HomeAssistant, State as State, callback as callback
14
14
  from homeassistant.exceptions import HomeAssistantError as HomeAssistantError
15
15
  from homeassistant.loader import bind_hass as bind_hass
16
- from typing import Any, TypeVar
16
+ from typing import Any
17
17
 
18
18
  _LOGGER: Incomplete
19
19
  _SlotsType = dict[str, Any]
20
- _T = TypeVar('_T')
21
20
  INTENT_TURN_OFF: str
22
21
  INTENT_TURN_ON: str
23
22
  INTENT_TOGGLE: str
@@ -7,13 +7,24 @@ from collections.abc import Iterable
7
7
  from dataclasses import dataclass
8
8
  from homeassistant.core import Event as Event, HomeAssistant as HomeAssistant, callback as callback
9
9
  from homeassistant.util import slugify as slugify
10
+ from homeassistant.util.event_type import EventType as EventType
10
11
  from typing import Literal, TypedDict
11
12
 
12
13
  DATA_REGISTRY: str
13
- EVENT_LABEL_REGISTRY_UPDATED: str
14
+ EVENT_LABEL_REGISTRY_UPDATED: EventType[EventLabelRegistryUpdatedData]
14
15
  STORAGE_KEY: str
15
16
  STORAGE_VERSION_MAJOR: int
16
17
 
18
+ class _LabelStoreData(TypedDict):
19
+ color: str | None
20
+ description: str | None
21
+ icon: str | None
22
+ label_id: str
23
+ name: str
24
+
25
+ class LabelRegistryStoreData(TypedDict):
26
+ labels: list[_LabelStoreData]
27
+
17
28
  class EventLabelRegistryUpdatedData(TypedDict):
18
29
  action: Literal['create', 'remove', 'update']
19
30
  label_id: str
@@ -27,7 +38,7 @@ class LabelEntry(NormalizedNameBaseRegistryEntry):
27
38
  icon: str | None = ...
28
39
  def __init__(self, *, name, normalized_name, label_id, description, color, icon) -> None: ...
29
40
 
30
- class LabelRegistry(BaseRegistry):
41
+ class LabelRegistry(BaseRegistry[LabelRegistryStoreData]):
31
42
  labels: NormalizedNameBaseRegistryItems[LabelEntry]
32
43
  _label_data: dict[str, LabelEntry]
33
44
  hass: Incomplete
@@ -41,7 +52,7 @@ class LabelRegistry(BaseRegistry):
41
52
  def async_delete(self, label_id: str) -> None: ...
42
53
  def async_update(self, label_id: str, *, color: str | None | UndefinedType = ..., description: str | None | UndefinedType = ..., icon: str | None | UndefinedType = ..., name: str | UndefinedType = ...) -> LabelEntry: ...
43
54
  async def async_load(self) -> None: ...
44
- def _data_to_save(self) -> dict[str, list[dict[str, str | None]]]: ...
55
+ def _data_to_save(self) -> LabelRegistryStoreData: ...
45
56
 
46
57
  def async_get(hass: HomeAssistant) -> LabelRegistry: ...
47
58
  async def async_load(hass: HomeAssistant) -> None: ...