homeassistant-stubs 2024.4.3__py3-none-any.whl → 2024.5.0__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 (374) 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/airthings/sensor.pyi +2 -0
  24. homeassistant-stubs/components/airtouch5/config_flow.pyi +3 -3
  25. homeassistant-stubs/components/airzone_cloud/entity.pyi +7 -0
  26. homeassistant-stubs/components/airzone_cloud/select.pyi +38 -0
  27. homeassistant-stubs/components/airzone_cloud/water_heater.pyi +35 -0
  28. homeassistant-stubs/components/alert/__init__.pyi +2 -2
  29. homeassistant-stubs/components/alexa/config.pyi +2 -0
  30. homeassistant-stubs/components/alexa/entities.pyi +0 -2
  31. homeassistant-stubs/components/alexa/intent.pyi +2 -1
  32. homeassistant-stubs/components/alexa/resources.pyi +3 -3
  33. homeassistant-stubs/components/alexa/state_report.pyi +3 -4
  34. homeassistant-stubs/components/ambient_network/__init__.pyi +10 -0
  35. homeassistant-stubs/components/ambient_network/config_flow.pyi +22 -0
  36. homeassistant-stubs/components/ambient_network/const.pyi +12 -0
  37. homeassistant-stubs/components/ambient_network/coordinator.pyi +18 -0
  38. homeassistant-stubs/components/ambient_network/entity.pyi +20 -0
  39. homeassistant-stubs/components/ambient_network/helper.pyi +4 -0
  40. homeassistant-stubs/components/ambient_network/sensor.pyi +46 -0
  41. homeassistant-stubs/components/ambient_station/sensor.pyi +3 -1
  42. homeassistant-stubs/components/apache_kafka/__init__.pyi +1 -2
  43. homeassistant-stubs/components/apcupsd/binary_sensor.pyi +1 -0
  44. homeassistant-stubs/components/apcupsd/sensor.pyi +1 -0
  45. homeassistant-stubs/components/api/__init__.pyi +2 -2
  46. homeassistant-stubs/components/apple_tv/remote.pyi +1 -1
  47. homeassistant-stubs/components/arris_tg2492lg/device_tracker.pyi +5 -4
  48. homeassistant-stubs/components/aseko_pool_live/binary_sensor.pyi +0 -1
  49. homeassistant-stubs/components/assist_pipeline/__init__.pyi +2 -2
  50. homeassistant-stubs/components/assist_pipeline/const.pyi +1 -0
  51. homeassistant-stubs/components/assist_pipeline/pipeline.pyi +5 -3
  52. homeassistant-stubs/components/auth/__init__.pyi +9 -2
  53. homeassistant-stubs/components/auth/login_flow.pyi +2 -2
  54. homeassistant-stubs/components/auth/mfa_setup_flow.pyi +1 -1
  55. homeassistant-stubs/components/automation/__init__.pyi +7 -9
  56. homeassistant-stubs/components/automation/logbook.pyi +3 -1
  57. homeassistant-stubs/components/axis/hub/event_source.pyi +23 -0
  58. homeassistant-stubs/components/axis/hub/hub.pyi +4 -9
  59. homeassistant-stubs/components/baf/fan.pyi +1 -0
  60. homeassistant-stubs/components/bayesian/binary_sensor.pyi +2 -2
  61. homeassistant-stubs/components/bluetooth/config_flow.pyi +6 -0
  62. homeassistant-stubs/components/bluetooth/diagnostics.pyi +1 -1
  63. homeassistant-stubs/components/bluetooth/util.pyi +2 -1
  64. homeassistant-stubs/components/bmw_connected_drive/binary_sensor.pyi +2 -1
  65. homeassistant-stubs/components/bmw_connected_drive/const.pyi +1 -0
  66. homeassistant-stubs/components/bmw_connected_drive/sensor.pyi +4 -3
  67. homeassistant-stubs/components/camera/__init__.pyi +2 -2
  68. homeassistant-stubs/components/cloud/__init__.pyi +9 -4
  69. homeassistant-stubs/components/cloud/alexa_config.pyi +2 -2
  70. homeassistant-stubs/components/cloud/const.pyi +2 -1
  71. homeassistant-stubs/components/cloud/google_config.pyi +3 -3
  72. homeassistant-stubs/components/cloud/http_api.pyi +2 -2
  73. homeassistant-stubs/components/cloud/prefs.pyi +5 -3
  74. homeassistant-stubs/components/cloud/stt.pyi +1 -0
  75. homeassistant-stubs/components/cloud/tts.pyi +1 -0
  76. homeassistant-stubs/components/cloud/util.pyi +7 -0
  77. homeassistant-stubs/components/command_line/binary_sensor.pyi +4 -4
  78. homeassistant-stubs/components/command_line/const.pyi +4 -1
  79. homeassistant-stubs/components/command_line/cover.pyi +3 -3
  80. homeassistant-stubs/components/command_line/sensor.pyi +4 -5
  81. homeassistant-stubs/components/command_line/switch.pyi +3 -3
  82. homeassistant-stubs/components/config/__init__.pyi +1 -1
  83. homeassistant-stubs/components/deconz/binary_sensor.pyi +0 -1
  84. homeassistant-stubs/components/demo/notify.pyi +12 -10
  85. homeassistant-stubs/components/demo/sensor.pyi +1 -1
  86. homeassistant-stubs/components/derivative/sensor.pyi +2 -2
  87. homeassistant-stubs/components/device_tracker/config_entry.pyi +1 -1
  88. homeassistant-stubs/components/device_tracker/legacy.pyi +2 -1
  89. homeassistant-stubs/components/dhcp/__init__.pyi +2 -2
  90. homeassistant-stubs/components/dlna_dms/dms.pyi +2 -1
  91. homeassistant-stubs/components/ecovacs/event.pyi +1 -0
  92. homeassistant-stubs/components/ecovacs/select.pyi +1 -1
  93. homeassistant-stubs/components/ecovacs/util.pyi +5 -1
  94. homeassistant-stubs/components/ecovacs/vacuum.pyi +1 -0
  95. homeassistant-stubs/components/emulated_hue/config.pyi +2 -2
  96. homeassistant-stubs/components/emulated_hue/hue_api.pyi +2 -2
  97. homeassistant-stubs/components/energenie_power_sockets/__init__.pyi +12 -0
  98. homeassistant-stubs/components/energenie_power_sockets/config_flow.pyi +6 -0
  99. homeassistant-stubs/components/energenie_power_sockets/const.pyi +5 -0
  100. homeassistant-stubs/components/energenie_power_sockets/switch.pyi +27 -0
  101. homeassistant-stubs/components/energy/data.pyi +1 -0
  102. homeassistant-stubs/components/energy/sensor.pyi +4 -4
  103. homeassistant-stubs/components/energy/websocket_api.pyi +1 -1
  104. homeassistant-stubs/components/enigma2/__init__.pyi +11 -0
  105. homeassistant-stubs/components/enigma2/config_flow.pyi +17 -0
  106. homeassistant-stubs/components/enigma2/const.pyi +1 -0
  107. homeassistant-stubs/components/enigma2/media_player.pyi +9 -6
  108. homeassistant-stubs/components/enphase_envoy/coordinator.pyi +1 -0
  109. homeassistant-stubs/components/eq3btsmart/__init__.pyi +18 -0
  110. homeassistant-stubs/components/eq3btsmart/climate.pyi +55 -0
  111. homeassistant-stubs/components/eq3btsmart/config_flow.pyi +17 -0
  112. homeassistant-stubs/components/eq3btsmart/const.pyi +38 -0
  113. homeassistant-stubs/components/eq3btsmart/entity.pyi +10 -0
  114. homeassistant-stubs/components/eq3btsmart/models.pyi +20 -0
  115. homeassistant-stubs/components/eq3btsmart/schemas.pyi +6 -0
  116. homeassistant-stubs/components/esphome/datetime.pyi +14 -0
  117. homeassistant-stubs/components/esphome/entry_data.pyi +4 -5
  118. homeassistant-stubs/components/esphome/event.pyi +16 -0
  119. homeassistant-stubs/components/esphome/manager.pyi +5 -4
  120. homeassistant-stubs/components/esphome/update.pyi +0 -1
  121. homeassistant-stubs/components/esphome/valve.pyi +30 -0
  122. homeassistant-stubs/components/esphome/voice_assistant.pyi +24 -8
  123. homeassistant-stubs/components/filter/sensor.pyi +2 -2
  124. homeassistant-stubs/components/fritz/__init__.pyi +2 -2
  125. homeassistant-stubs/components/fritz/button.pyi +16 -3
  126. homeassistant-stubs/components/fritz/common.pyi +6 -3
  127. homeassistant-stubs/components/fritz/config_flow.pyi +7 -2
  128. homeassistant-stubs/components/fritz/const.pyi +5 -1
  129. homeassistant-stubs/components/fritzbox/climate.pyi +1 -1
  130. homeassistant-stubs/components/fritzbox/config_flow.pyi +2 -0
  131. homeassistant-stubs/components/fritzbox/coordinator.pyi +4 -2
  132. homeassistant-stubs/components/generic_hygrostat/humidifier.pyi +4 -2
  133. homeassistant-stubs/components/generic_thermostat/climate.pyi +2 -2
  134. homeassistant-stubs/components/geo_location/trigger.pyi +2 -2
  135. homeassistant-stubs/components/glances/coordinator.pyi +1 -0
  136. homeassistant-stubs/components/glances/sensor.pyi +6 -5
  137. homeassistant-stubs/components/group/entity.pyi +6 -12
  138. homeassistant-stubs/components/group/event.pyi +2 -2
  139. homeassistant-stubs/components/group/media_player.pyi +2 -2
  140. homeassistant-stubs/components/group/notify.pyi +2 -1
  141. homeassistant-stubs/components/group/registry.pyi +6 -4
  142. homeassistant-stubs/components/history/websocket_api.pyi +6 -6
  143. homeassistant-stubs/components/history_stats/coordinator.pyi +2 -2
  144. homeassistant-stubs/components/history_stats/data.pyi +1 -2
  145. homeassistant-stubs/components/homeassistant/logbook.pyi +5 -3
  146. homeassistant-stubs/components/homeassistant/triggers/numeric_state.pyi +2 -2
  147. homeassistant-stubs/components/homeassistant/triggers/state.pyi +2 -2
  148. homeassistant-stubs/components/homeassistant/triggers/time.pyi +2 -2
  149. homeassistant-stubs/components/homeassistant_alerts/__init__.pyi +3 -1
  150. homeassistant-stubs/components/homeassistant_sky_connect/__init__.pyi +7 -9
  151. homeassistant-stubs/components/homeassistant_sky_connect/config_flow.pyi +61 -6
  152. homeassistant-stubs/components/homeassistant_sky_connect/const.pyi +8 -0
  153. homeassistant-stubs/components/homeassistant_sky_connect/util.pyi +23 -2
  154. homeassistant-stubs/components/homekit/accessories.pyi +2 -2
  155. homeassistant-stubs/components/homekit/type_cameras.pyi +3 -2
  156. homeassistant-stubs/components/homekit/type_covers.pyi +2 -2
  157. homeassistant-stubs/components/homekit/type_humidifiers.pyi +2 -2
  158. homeassistant-stubs/components/homekit/type_thermostats.pyi +2 -2
  159. homeassistant-stubs/components/homekit/util.pyi +3 -4
  160. homeassistant-stubs/components/homeworks/__init__.pyi +7 -2
  161. homeassistant-stubs/components/homeworks/button.pyi +1 -1
  162. homeassistant-stubs/components/http/__init__.pyi +9 -6
  163. homeassistant-stubs/components/http/auth.pyi +11 -3
  164. homeassistant-stubs/components/http/const.pyi +7 -0
  165. homeassistant-stubs/components/http/session.pyi +29 -0
  166. homeassistant-stubs/components/hydrawise/__init__.pyi +3 -6
  167. homeassistant-stubs/components/hydrawise/binary_sensor.pyi +1 -4
  168. homeassistant-stubs/components/hydrawise/config_flow.pyi +8 -9
  169. homeassistant-stubs/components/hydrawise/sensor.pyi +2 -4
  170. homeassistant-stubs/components/hydrawise/switch.pyi +2 -5
  171. homeassistant-stubs/components/image/__init__.pyi +2 -2
  172. homeassistant-stubs/components/imap/__init__.pyi +20 -4
  173. homeassistant-stubs/components/imap/config_flow.pyi +2 -1
  174. homeassistant-stubs/components/imap/const.pyi +5 -2
  175. homeassistant-stubs/components/imap/coordinator.pyi +5 -2
  176. homeassistant-stubs/components/integration/sensor.pyi +12 -13
  177. homeassistant-stubs/components/islamic_prayer_times/config_flow.pyi +1 -3
  178. homeassistant-stubs/components/islamic_prayer_times/coordinator.pyi +4 -4
  179. homeassistant-stubs/components/isy994/helpers.pyi +1 -1
  180. homeassistant-stubs/components/jvc_projector/select.pyi +30 -0
  181. homeassistant-stubs/components/knx/expose.pyi +2 -2
  182. homeassistant-stubs/components/knx/helpers/__init__.pyi +0 -0
  183. homeassistant-stubs/components/knx/notify.pyi +16 -3
  184. homeassistant-stubs/components/knx/repairs.pyi +7 -0
  185. homeassistant-stubs/components/local_todo/todo.pyi +1 -0
  186. homeassistant-stubs/components/logbook/__init__.pyi +1 -0
  187. homeassistant-stubs/components/logbook/helpers.pyi +5 -4
  188. homeassistant-stubs/components/logbook/models.pyi +4 -3
  189. homeassistant-stubs/components/logbook/processor.pyi +3 -2
  190. homeassistant-stubs/components/logger/helpers.pyi +4 -1
  191. homeassistant-stubs/components/matter/config_flow.pyi +4 -0
  192. homeassistant-stubs/components/matter/light.pyi +3 -0
  193. homeassistant-stubs/components/media_extractor/__init__.pyi +4 -4
  194. homeassistant-stubs/components/media_extractor/const.pyi +5 -0
  195. homeassistant-stubs/components/min_max/sensor.pyi +2 -2
  196. homeassistant-stubs/components/minecraft_server/sensor.pyi +2 -2
  197. homeassistant-stubs/components/modbus/__init__.pyi +2 -2
  198. homeassistant-stubs/components/modbus/base_platform.pyi +1 -1
  199. homeassistant-stubs/components/modbus/climate.pyi +9 -3
  200. homeassistant-stubs/components/modbus/const.pyi +7 -0
  201. homeassistant-stubs/components/modbus/modbus.pyi +1 -0
  202. homeassistant-stubs/components/modbus/validators.pyi +2 -1
  203. homeassistant-stubs/components/mqtt/__init__.pyi +1 -2
  204. homeassistant-stubs/components/mqtt/client.pyi +37 -12
  205. homeassistant-stubs/components/mqtt/config_flow.pyi +9 -1
  206. homeassistant-stubs/components/mqtt/mixins.pyi +7 -4
  207. homeassistant-stubs/components/mqtt/models.pyi +1 -1
  208. homeassistant-stubs/components/mqtt/notify.pyi +31 -0
  209. homeassistant-stubs/components/mysensors/gateway.pyi +1 -0
  210. homeassistant-stubs/components/netatmo/__init__.pyi +2 -0
  211. homeassistant-stubs/components/netatmo/binary_sensor.pyi +20 -0
  212. homeassistant-stubs/components/netatmo/camera.pyi +8 -11
  213. homeassistant-stubs/components/netatmo/climate.pyi +11 -19
  214. homeassistant-stubs/components/netatmo/cover.pyi +5 -7
  215. homeassistant-stubs/components/netatmo/entity.pyi +40 -10
  216. homeassistant-stubs/components/netatmo/fan.pyi +5 -8
  217. homeassistant-stubs/components/netatmo/light.pyi +11 -19
  218. homeassistant-stubs/components/netatmo/select.pyi +4 -7
  219. homeassistant-stubs/components/netatmo/sensor.pyi +36 -49
  220. homeassistant-stubs/components/netatmo/switch.pyi +5 -7
  221. homeassistant-stubs/components/nextdns/__init__.pyi +1 -38
  222. homeassistant-stubs/components/nextdns/binary_sensor.pyi +1 -1
  223. homeassistant-stubs/components/nextdns/button.pyi +1 -1
  224. homeassistant-stubs/components/nextdns/coordinator.pyi +42 -0
  225. homeassistant-stubs/components/nextdns/sensor.pyi +1 -1
  226. homeassistant-stubs/components/nextdns/switch.pyi +1 -1
  227. homeassistant-stubs/components/nfandroidtv/notify.pyi +2 -1
  228. homeassistant-stubs/components/notify/__init__.pyi +31 -2
  229. homeassistant-stubs/components/notify/const.pyi +2 -0
  230. homeassistant-stubs/components/number/const.pyi +1 -0
  231. homeassistant-stubs/components/number/significant_change.pyi +1 -1
  232. homeassistant-stubs/components/oncue/__init__.pyi +2 -1
  233. homeassistant-stubs/components/oncue/config_flow.pyi +7 -1
  234. homeassistant-stubs/components/onewire/model.pyi +1 -1
  235. homeassistant-stubs/components/onewire/onewirehub.pyi +2 -2
  236. homeassistant-stubs/components/open_meteo/weather.pyi +2 -1
  237. homeassistant-stubs/components/prometheus/__init__.pyi +1 -2
  238. homeassistant-stubs/components/proximity/__init__.pyi +1 -1
  239. homeassistant-stubs/components/proximity/coordinator.pyi +2 -2
  240. homeassistant-stubs/components/purpleair/config_flow.pyi +2 -2
  241. homeassistant-stubs/components/rabbitair/config_flow.pyi +4 -4
  242. homeassistant-stubs/components/recorder/__init__.pyi +1 -0
  243. homeassistant-stubs/components/recorder/auto_repairs/states/__init__.pyi +0 -0
  244. homeassistant-stubs/components/recorder/core.pyi +6 -5
  245. homeassistant-stubs/components/recorder/db_schema.pyi +3 -3
  246. homeassistant-stubs/components/recorder/history/__init__.pyi +5 -6
  247. homeassistant-stubs/components/recorder/history/legacy.pyi +7 -7
  248. homeassistant-stubs/components/recorder/history/modern.pyi +7 -7
  249. homeassistant-stubs/components/recorder/models/event.pyi +4 -1
  250. homeassistant-stubs/components/recorder/pool.pyi +1 -1
  251. homeassistant-stubs/components/recorder/services.pyi +1 -0
  252. homeassistant-stubs/components/recorder/statistics.pyi +4 -4
  253. homeassistant-stubs/components/recorder/table_managers/__init__.pyi +4 -3
  254. homeassistant-stubs/components/recorder/table_managers/event_types.pyi +5 -3
  255. homeassistant-stubs/components/recorder/table_managers/state_attributes.pyi +3 -3
  256. homeassistant-stubs/components/recorder/table_managers/states_meta.pyi +2 -2
  257. homeassistant-stubs/components/recorder/table_managers/statistics_meta.pyi +3 -3
  258. homeassistant-stubs/components/recorder/tasks.pyi +2 -1
  259. homeassistant-stubs/components/recorder/websocket_api.pyi +1 -1
  260. homeassistant-stubs/components/rest/__init__.pyi +2 -2
  261. homeassistant-stubs/components/rest/const.pyi +1 -0
  262. homeassistant-stubs/components/rest/data.pyi +1 -0
  263. homeassistant-stubs/components/rest/schema.pyi +1 -1
  264. homeassistant-stubs/components/rfxtrx/__init__.pyi +1 -1
  265. homeassistant-stubs/components/rfxtrx/config_flow.pyi +2 -2
  266. homeassistant-stubs/components/rfxtrx/event.pyi +1 -0
  267. homeassistant-stubs/components/ring/__init__.pyi +25 -0
  268. homeassistant-stubs/components/ring/binary_sensor.pyi +35 -0
  269. homeassistant-stubs/components/ring/button.pyi +20 -0
  270. homeassistant-stubs/components/ring/camera.pyi +43 -0
  271. homeassistant-stubs/components/ring/config_flow.pyi +26 -0
  272. homeassistant-stubs/components/ring/const.pyi +12 -0
  273. homeassistant-stubs/components/ring/coordinator.pyi +25 -0
  274. homeassistant-stubs/components/ring/diagnostics.pyi +11 -0
  275. homeassistant-stubs/components/ring/entity.pyi +33 -0
  276. homeassistant-stubs/components/ring/light.pyi +34 -0
  277. homeassistant-stubs/components/ring/sensor.pyi +39 -0
  278. homeassistant-stubs/components/ring/siren.pyi +23 -0
  279. homeassistant-stubs/components/ring/switch.pyi +31 -0
  280. homeassistant-stubs/components/romy/binary_sensor.pyi +19 -0
  281. homeassistant-stubs/components/romy/config_flow.pyi +7 -7
  282. homeassistant-stubs/components/romy/sensor.pyi +20 -0
  283. homeassistant-stubs/components/sensor/__init__.pyi +1 -1
  284. homeassistant-stubs/components/sensor/significant_change.pyi +1 -1
  285. homeassistant-stubs/components/shelly/__init__.pyi +2 -4
  286. homeassistant-stubs/components/shelly/coordinator.pyi +8 -7
  287. homeassistant-stubs/components/shelly/switch.pyi +1 -1
  288. homeassistant-stubs/components/shelly/utils.pyi +1 -0
  289. homeassistant-stubs/components/starlink/coordinator.pyi +1 -0
  290. homeassistant-stubs/components/statistics/sensor.pyi +2 -2
  291. homeassistant-stubs/components/switch/light.pyi +2 -2
  292. homeassistant-stubs/components/synology_dsm/__init__.pyi +2 -2
  293. homeassistant-stubs/components/synology_dsm/camera.pyi +3 -2
  294. homeassistant-stubs/components/synology_dsm/common.pyi +6 -2
  295. homeassistant-stubs/components/synology_dsm/coordinator.pyi +4 -4
  296. homeassistant-stubs/components/synology_dsm/diagnostics.pyi +0 -1
  297. homeassistant-stubs/components/system_log/__init__.pyi +3 -3
  298. homeassistant-stubs/components/threshold/binary_sensor.pyi +2 -2
  299. homeassistant-stubs/components/tibber/sensor.pyi +1 -0
  300. homeassistant-stubs/components/tplink/coordinator.pyi +2 -0
  301. homeassistant-stubs/components/tplink/entity.pyi +1 -0
  302. homeassistant-stubs/components/tplink/light.pyi +1 -1
  303. homeassistant-stubs/components/tplink/sensor.pyi +4 -3
  304. homeassistant-stubs/components/tplink_omada/switch.pyi +12 -14
  305. homeassistant-stubs/components/trend/binary_sensor.pyi +2 -2
  306. homeassistant-stubs/components/unifi/__init__.pyi +2 -0
  307. homeassistant-stubs/components/unifi/button.pyi +2 -1
  308. homeassistant-stubs/components/unifi/hub/entity_helper.pyi +44 -0
  309. homeassistant-stubs/components/unifi/hub/hub.pyi +8 -13
  310. homeassistant-stubs/components/unifi/sensor.pyi +2 -1
  311. homeassistant-stubs/components/velbus/cover.pyi +2 -0
  312. homeassistant-stubs/components/weather/significant_change.pyi +1 -1
  313. homeassistant-stubs/components/websocket_api/commands.pyi +2 -2
  314. homeassistant-stubs/components/websocket_api/messages.pyi +1 -2
  315. homeassistant-stubs/components/websocket_api/sensor.pyi +3 -7
  316. homeassistant-stubs/components/withings/__init__.pyi +2 -8
  317. homeassistant-stubs/components/withings/config_flow.pyi +1 -1
  318. homeassistant-stubs/components/withings/const.pyi +0 -2
  319. homeassistant-stubs/components/withings/coordinator.pyi +1 -0
  320. homeassistant-stubs/components/zone/__init__.pyi +8 -10
  321. homeassistant-stubs/components/zone/trigger.pyi +2 -2
  322. homeassistant-stubs/components/zwave_js/config_flow.pyi +1 -1
  323. homeassistant-stubs/config.pyi +1 -1
  324. homeassistant-stubs/config_entries.pyi +32 -29
  325. homeassistant-stubs/const.pyi +11 -6
  326. homeassistant-stubs/core.pyi +57 -24
  327. homeassistant-stubs/data_entry_flow.pyi +3 -3
  328. homeassistant-stubs/exceptions.pyi +4 -2
  329. homeassistant-stubs/helpers/aiohttp_client.pyi +1 -0
  330. homeassistant-stubs/helpers/area_registry.pyi +28 -6
  331. homeassistant-stubs/helpers/backports/__init__.pyi +0 -0
  332. homeassistant-stubs/helpers/backports/aiohttp_resolver.pyi +21 -0
  333. homeassistant-stubs/helpers/category_registry.pyi +16 -6
  334. homeassistant-stubs/helpers/data_entry_flow.pyi +1 -1
  335. homeassistant-stubs/helpers/deprecation.pyi +5 -0
  336. homeassistant-stubs/helpers/device_registry.pyi +25 -12
  337. homeassistant-stubs/helpers/dispatcher.pyi +1 -1
  338. homeassistant-stubs/helpers/entity.pyi +6 -3
  339. homeassistant-stubs/helpers/entity_registry.pyi +24 -16
  340. homeassistant-stubs/helpers/event.pyi +10 -17
  341. homeassistant-stubs/helpers/floor_registry.pyi +14 -3
  342. homeassistant-stubs/helpers/frame.pyi +2 -2
  343. homeassistant-stubs/helpers/httpx_client.pyi +1 -1
  344. homeassistant-stubs/helpers/icon.pyi +3 -2
  345. homeassistant-stubs/helpers/intent.pyi +1 -2
  346. homeassistant-stubs/helpers/label_registry.pyi +14 -3
  347. homeassistant-stubs/helpers/network.pyi +2 -2
  348. homeassistant-stubs/helpers/normalized_name_base_registry.pyi +4 -6
  349. homeassistant-stubs/helpers/registry.pyi +19 -4
  350. homeassistant-stubs/helpers/reload.pyi +1 -1
  351. homeassistant-stubs/helpers/schema_config_entry_flow.pyi +2 -2
  352. homeassistant-stubs/helpers/script.pyi +2 -1
  353. homeassistant-stubs/helpers/service.pyi +4 -1
  354. homeassistant-stubs/helpers/significant_change.pyi +4 -4
  355. homeassistant-stubs/helpers/start.pyi +3 -1
  356. homeassistant-stubs/helpers/template.pyi +6 -3
  357. homeassistant-stubs/helpers/translation.pyi +5 -9
  358. homeassistant-stubs/helpers/typing.pyi +11 -7
  359. homeassistant-stubs/helpers/update_coordinator.pyi +2 -1
  360. homeassistant-stubs/requirements.pyi +2 -0
  361. homeassistant-stubs/setup.pyi +1 -0
  362. homeassistant-stubs/util/async_.pyi +1 -6
  363. homeassistant-stubs/util/dt.pyi +5 -4
  364. homeassistant-stubs/util/event_type.pyi +14 -0
  365. homeassistant-stubs/util/logging.pyi +3 -4
  366. homeassistant-stubs/util/loop.pyi +15 -0
  367. homeassistant-stubs/util/signal_type.pyi +1 -1
  368. homeassistant-stubs/util/timeout.pyi +6 -6
  369. homeassistant-stubs/util/yaml/loader.pyi +3 -4
  370. homeassistant-stubs/util/yaml/objects.pyi +12 -2
  371. {homeassistant_stubs-2024.4.3.dist-info → homeassistant_stubs-2024.5.0.dist-info}/METADATA +2 -2
  372. {homeassistant_stubs-2024.4.3.dist-info → homeassistant_stubs-2024.5.0.dist-info}/RECORD +374 -317
  373. {homeassistant_stubs-2024.4.3.dist-info → homeassistant_stubs-2024.5.0.dist-info}/LICENSE +0 -0
  374. {homeassistant_stubs-2024.4.3.dist-info → homeassistant_stubs-2024.5.0.dist-info}/WHEEL +0 -0
@@ -3,18 +3,19 @@ import datetime
3
3
  import enum
4
4
  import threading
5
5
  import voluptuous as vol
6
- from . import block_async_io as block_async_io, util as util
6
+ from . import util as util
7
7
  from .auth import AuthManager as AuthManager
8
8
  from .components.http import ApiConfig as ApiConfig, HomeAssistantHTTP as HomeAssistantHTTP
9
9
  from .config_entries import ConfigEntries as ConfigEntries
10
10
  from .const import ATTR_DOMAIN as ATTR_DOMAIN, ATTR_FRIENDLY_NAME as ATTR_FRIENDLY_NAME, ATTR_SERVICE as ATTR_SERVICE, ATTR_SERVICE_DATA as ATTR_SERVICE_DATA, COMPRESSED_STATE_ATTRIBUTES as COMPRESSED_STATE_ATTRIBUTES, COMPRESSED_STATE_CONTEXT as COMPRESSED_STATE_CONTEXT, COMPRESSED_STATE_LAST_CHANGED as COMPRESSED_STATE_LAST_CHANGED, COMPRESSED_STATE_LAST_UPDATED as COMPRESSED_STATE_LAST_UPDATED, COMPRESSED_STATE_STATE as COMPRESSED_STATE_STATE, EVENT_CALL_SERVICE as EVENT_CALL_SERVICE, EVENT_CORE_CONFIG_UPDATE as EVENT_CORE_CONFIG_UPDATE, EVENT_HOMEASSISTANT_CLOSE as EVENT_HOMEASSISTANT_CLOSE, EVENT_HOMEASSISTANT_FINAL_WRITE as EVENT_HOMEASSISTANT_FINAL_WRITE, EVENT_HOMEASSISTANT_START as EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STARTED as EVENT_HOMEASSISTANT_STARTED, EVENT_HOMEASSISTANT_STOP as EVENT_HOMEASSISTANT_STOP, EVENT_LOGGING_CHANGED as EVENT_LOGGING_CHANGED, EVENT_SERVICE_REGISTERED as EVENT_SERVICE_REGISTERED, EVENT_SERVICE_REMOVED as EVENT_SERVICE_REMOVED, EVENT_STATE_CHANGED as EVENT_STATE_CHANGED, EVENT_STATE_REPORTED as EVENT_STATE_REPORTED, MATCH_ALL as MATCH_ALL, MAX_LENGTH_EVENT_EVENT_TYPE as MAX_LENGTH_EVENT_EVENT_TYPE, MAX_LENGTH_STATE_STATE as MAX_LENGTH_STATE_STATE, UnitOfLength as UnitOfLength, __version__ as __version__
11
- from .exceptions import HomeAssistantError as HomeAssistantError, InvalidEntityFormatError as InvalidEntityFormatError, InvalidStateError as InvalidStateError, MaxLengthExceeded as MaxLengthExceeded, ServiceNotFound as ServiceNotFound, Unauthorized as Unauthorized
11
+ from .exceptions import HomeAssistantError as HomeAssistantError, InvalidEntityFormatError as InvalidEntityFormatError, InvalidStateError as InvalidStateError, MaxLengthExceeded as MaxLengthExceeded, ServiceNotFound as ServiceNotFound, ServiceValidationError as ServiceValidationError, Unauthorized as Unauthorized
12
12
  from .helpers.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
13
13
  from .helpers.entity import StateInfo as StateInfo
14
14
  from .helpers.json import json_bytes as json_bytes, json_fragment as json_fragment
15
15
  from .helpers.storage import Store as Store
16
16
  from .util import location as location
17
17
  from .util.async_ import cancelling as cancelling, create_eager_task as create_eager_task, run_callback_threadsafe as run_callback_threadsafe, shutdown_run_callback_threadsafe as shutdown_run_callback_threadsafe
18
+ from .util.event_type import EventType as EventType
18
19
  from .util.executor import InterruptibleThreadPoolExecutor as InterruptibleThreadPoolExecutor
19
20
  from .util.json import JsonObjectType as JsonObjectType
20
21
  from .util.read_only_dict import ReadOnlyDict as ReadOnlyDict
@@ -26,7 +27,7 @@ from collections import UserDict
26
27
  from collections.abc import Callable, Collection, Coroutine, Iterable, KeysView, Mapping, ValuesView
27
28
  from dataclasses import dataclass
28
29
  from functools import cached_property as cached_property
29
- from typing import Any, Generic, Literal, NotRequired, ParamSpec, Self, TypeVarTuple, TypedDict, overload
30
+ from typing import Any, Generic, NotRequired, ParamSpec, Self, TypeVarTuple, TypedDict, overload
30
31
  from typing_extensions import TypeVar
31
32
 
32
33
  STOPPING_STAGE_SHUTDOWN_TIMEOUT: int
@@ -39,6 +40,7 @@ _R_co = TypeVar('_R_co', covariant=True)
39
40
  _P = ParamSpec('_P')
40
41
  _Ts = TypeVarTuple('_Ts')
41
42
  _UNDEF: dict[Any, Any]
43
+ _SENTINEL: Incomplete
42
44
  _CallableT = TypeVar('_CallableT', bound=Callable[..., Any])
43
45
  _DataT = TypeVar('_DataT', bound=Mapping[str, Any], default=Mapping[str, Any])
44
46
  CALLBACK_TYPE = Callable[[], None]
@@ -56,6 +58,11 @@ class ConfigSource(enum.StrEnum):
56
58
  STORAGE: str
57
59
  YAML: str
58
60
 
61
+ class EventStateChangedData(TypedDict):
62
+ entity_id: str
63
+ old_state: State | None
64
+ new_state: State | None
65
+
59
66
  _DEPRECATED_SOURCE_DISCOVERED: Incomplete
60
67
  _DEPRECATED_SOURCE_STORAGE: Incomplete
61
68
  _DEPRECATED_SOURCE_YAML: Incomplete
@@ -84,7 +91,14 @@ class _Hass(threading.local):
84
91
  _hass: Incomplete
85
92
 
86
93
  def async_get_hass() -> HomeAssistant: ...
87
- def get_release_channel() -> Literal['beta', 'dev', 'nightly', 'stable']: ...
94
+
95
+ class ReleaseChannel(enum.StrEnum):
96
+ BETA: str
97
+ DEV: str
98
+ NIGHTLY: str
99
+ STABLE: str
100
+
101
+ def get_release_channel() -> ReleaseChannel: ...
88
102
 
89
103
  class HassJobType(enum.Enum):
90
104
  Coroutinefunction: int
@@ -124,7 +138,7 @@ class HomeAssistant:
124
138
  auth: AuthManager
125
139
  http: HomeAssistantHTTP
126
140
  config_entries: ConfigEntries
127
- def __new__(cls, config_dir: str) -> HomeAssistant: ...
141
+ def __new__(cls, config_dir: str) -> Self: ...
128
142
  def __repr__(self) -> str: ...
129
143
  data: Incomplete
130
144
  loop: Incomplete
@@ -144,6 +158,7 @@ class HomeAssistant:
144
158
  _shutdown_jobs: Incomplete
145
159
  import_executor: Incomplete
146
160
  def __init__(self, config_dir: str) -> None: ...
161
+ def verify_event_loop_thread(self, what: str) -> None: ...
147
162
  @property
148
163
  def _active_tasks(self) -> set[asyncio.Future[Any]]: ...
149
164
  @cached_property
@@ -165,9 +180,14 @@ class HomeAssistant:
165
180
  def async_add_hass_job(self, hassjob: HassJob[..., Coroutine[Any, Any, _R]], *args: Any, eager_start: bool = False, background: bool = False) -> asyncio.Future[_R] | None: ...
166
181
  @overload
167
182
  def async_add_hass_job(self, hassjob: HassJob[..., Coroutine[Any, Any, _R] | _R], *args: Any, eager_start: bool = False, background: bool = False) -> asyncio.Future[_R] | None: ...
183
+ @overload
184
+ def _async_add_hass_job(self, hassjob: HassJob[..., Coroutine[Any, Any, _R]], *args: Any, eager_start: bool = False, background: bool = False) -> asyncio.Future[_R] | None: ...
185
+ @overload
186
+ def _async_add_hass_job(self, hassjob: HassJob[..., Coroutine[Any, Any, _R] | _R], *args: Any, eager_start: bool = False, background: bool = False) -> asyncio.Future[_R] | None: ...
168
187
  def create_task(self, target: Coroutine[Any, Any, Any], name: str | None = None) -> None: ...
169
- def async_create_task(self, target: Coroutine[Any, Any, _R], name: str | None = None, eager_start: bool = False) -> asyncio.Task[_R]: ...
170
- def async_create_background_task(self, target: Coroutine[Any, Any, _R], name: str, eager_start: bool = False) -> asyncio.Task[_R]: ...
188
+ def async_create_task(self, target: Coroutine[Any, Any, _R], name: str | None = None, eager_start: bool = True) -> asyncio.Task[_R]: ...
189
+ def async_create_task_internal(self, target: Coroutine[Any, Any, _R], name: str | None = None, eager_start: bool = True) -> asyncio.Task[_R]: ...
190
+ def async_create_background_task(self, target: Coroutine[Any, Any, _R], name: str, eager_start: bool = True) -> asyncio.Task[_R]: ...
171
191
  def async_add_executor_job(self, target: Callable[[Unpack[_Ts]], _T], *args: Unpack[_Ts]) -> asyncio.Future[_T]: ...
172
192
  def async_add_import_executor_job(self, target: Callable[[Unpack[_Ts]], _T], *args: Unpack[_Ts]) -> asyncio.Future[_T]: ...
173
193
  @overload
@@ -198,7 +218,7 @@ class Context:
198
218
  parent_id: Incomplete
199
219
  origin_event: Incomplete
200
220
  def __init__(self, user_id: str | None = None, parent_id: str | None = None, id: str | None = None) -> None: ...
201
- def __eq__(self, other: Any) -> bool: ...
221
+ def __eq__(self, other: object) -> bool: ...
202
222
  @cached_property
203
223
  def _as_dict(self) -> dict[str, str | None]: ...
204
224
  def as_dict(self) -> ReadOnlyDict[str, str | None]: ...
@@ -218,7 +238,7 @@ class Event(Generic[_DataT]):
218
238
  origin: Incomplete
219
239
  time_fired_timestamp: Incomplete
220
240
  context: Incomplete
221
- def __init__(self, event_type: str, data: _DataT | None = None, origin: EventOrigin = ..., time_fired_timestamp: float | None = None, context: Context | None = None) -> None: ...
241
+ def __init__(self, event_type: EventType[_DataT] | str, data: _DataT | None = None, origin: EventOrigin = ..., time_fired_timestamp: float | None = None, context: Context | None = None) -> None: ...
222
242
  @cached_property
223
243
  def time_fired(self) -> datetime.datetime: ...
224
244
  @cached_property
@@ -230,21 +250,23 @@ class Event(Generic[_DataT]):
230
250
  def json_fragment(self) -> json_fragment: ...
231
251
  def __repr__(self) -> str: ...
232
252
 
233
- def _event_repr(event_type: str, origin: EventOrigin, data: Mapping[str, Any] | None) -> str: ...
253
+ def _event_repr(event_type: EventType[_DataT] | str, origin: EventOrigin, data: _DataT | None) -> str: ...
234
254
 
235
255
  _FilterableJobType: Incomplete
236
256
 
237
257
  @dataclass(slots=True)
238
- class _OneTimeListener:
258
+ class _OneTimeListener(Generic[_DataT]):
239
259
  hass: HomeAssistant
240
- listener_job: HassJob[[Event], Coroutine[Any, Any, None] | None]
260
+ listener_job: HassJob[[Event[_DataT]], Coroutine[Any, Any, None] | None]
241
261
  remove: CALLBACK_TYPE | None = ...
242
- def __call__(self, event: Event) -> None: ...
262
+ def __call__(self, event: Event[_DataT]) -> None: ...
243
263
  def __repr__(self) -> str: ...
244
264
  def __init__(self, hass, listener_job, remove) -> None: ...
245
265
 
246
266
  EMPTY_LIST: list[Any]
247
267
 
268
+ def _verify_event_type_length_or_raise(event_type: EventType[_DataT] | str) -> None: ...
269
+
248
270
  class EventBus:
249
271
  __slots__: Incomplete
250
272
  _listeners: Incomplete
@@ -253,18 +275,18 @@ class EventBus:
253
275
  def __init__(self, hass: HomeAssistant) -> None: ...
254
276
  _debug: Incomplete
255
277
  def _async_logging_changed(self, event: Event | None = None) -> None: ...
256
- def async_listeners(self) -> dict[str, int]: ...
278
+ def async_listeners(self) -> dict[EventType[Any] | str, int]: ...
257
279
  @property
258
- def listeners(self) -> dict[str, int]: ...
259
- def fire(self, event_type: str, event_data: Mapping[str, Any] | None = None, origin: EventOrigin = ..., context: Context | None = None) -> None: ...
260
- def async_fire(self, event_type: str, event_data: Mapping[str, Any] | None = None, origin: EventOrigin = ..., context: Context | None = None, time_fired: float | None = None) -> None: ...
261
- def _async_fire(self, event_type: str, event_data: Mapping[str, Any] | None = None, origin: EventOrigin = ..., context: Context | None = None, time_fired: float | None = None) -> None: ...
262
- def listen(self, event_type: str, listener: Callable[[Event[Any]], Coroutine[Any, Any, None] | None]) -> CALLBACK_TYPE: ...
263
- def async_listen(self, event_type: str, listener: Callable[[Event[_DataT]], Coroutine[Any, Any, None] | None], event_filter: Callable[[_DataT], bool] | None = None, run_immediately: bool = False) -> CALLBACK_TYPE: ...
264
- def _async_listen_filterable_job(self, event_type: str, filterable_job: _FilterableJobType[Any]) -> CALLBACK_TYPE: ...
265
- def listen_once(self, event_type: str, listener: Callable[[Event[Any]], Coroutine[Any, Any, None] | None]) -> CALLBACK_TYPE: ...
266
- def async_listen_once(self, event_type: str, listener: Callable[[Event[Any]], Coroutine[Any, Any, None] | None], run_immediately: bool = False) -> CALLBACK_TYPE: ...
267
- def _async_remove_listener(self, event_type: str, filterable_job: _FilterableJobType) -> None: ...
280
+ def listeners(self) -> dict[EventType[Any] | str, int]: ...
281
+ def fire(self, event_type: EventType[_DataT] | str, event_data: _DataT | None = None, origin: EventOrigin = ..., context: Context | None = None) -> None: ...
282
+ def async_fire(self, event_type: EventType[_DataT] | str, event_data: _DataT | None = None, origin: EventOrigin = ..., context: Context | None = None, time_fired: float | None = None) -> None: ...
283
+ def async_fire_internal(self, event_type: EventType[_DataT] | str, event_data: _DataT | None = None, origin: EventOrigin = ..., context: Context | None = None, time_fired: float | None = None) -> None: ...
284
+ def listen(self, event_type: EventType[_DataT] | str, listener: Callable[[Event[_DataT]], Coroutine[Any, Any, None] | None]) -> CALLBACK_TYPE: ...
285
+ def async_listen(self, event_type: EventType[_DataT] | str, listener: Callable[[Event[_DataT]], Coroutine[Any, Any, None] | None], event_filter: Callable[[_DataT], bool] | None = None, run_immediately: bool | object = ...) -> CALLBACK_TYPE: ...
286
+ def _async_listen_filterable_job(self, event_type: EventType[_DataT] | str, filterable_job: _FilterableJobType[_DataT]) -> CALLBACK_TYPE: ...
287
+ def listen_once(self, event_type: EventType[_DataT] | str, listener: Callable[[Event[_DataT]], Coroutine[Any, Any, None] | None]) -> CALLBACK_TYPE: ...
288
+ def async_listen_once(self, event_type: EventType[_DataT] | str, listener: Callable[[Event[_DataT]], Coroutine[Any, Any, None] | None], run_immediately: bool | object = ...) -> CALLBACK_TYPE: ...
289
+ def _async_remove_listener(self, event_type: EventType[_DataT] | str, filterable_job: _FilterableJobType[_DataT]) -> None: ...
268
290
 
269
291
  class CompressedState(TypedDict):
270
292
  s: str
@@ -376,19 +398,29 @@ class ServiceRegistry:
376
398
  def supports_response(self, domain: str, service: str) -> SupportsResponse: ...
377
399
  def register(self, domain: str, service: str, service_func: Callable[[ServiceCall], Coroutine[Any, Any, ServiceResponse] | ServiceResponse | None], schema: vol.Schema | None = None, supports_response: SupportsResponse = ...) -> None: ...
378
400
  def async_register(self, domain: str, service: str, service_func: Callable[[ServiceCall], Coroutine[Any, Any, ServiceResponse | EntityServiceResponse] | ServiceResponse | EntityServiceResponse | None], schema: vol.Schema | None = None, supports_response: SupportsResponse = ..., job_type: HassJobType | None = None) -> None: ...
401
+ def _async_register(self, domain: str, service: str, service_func: Callable[[ServiceCall], Coroutine[Any, Any, ServiceResponse | EntityServiceResponse] | ServiceResponse | EntityServiceResponse | None], schema: vol.Schema | None = None, supports_response: SupportsResponse = ..., job_type: HassJobType | None = None) -> None: ...
379
402
  def remove(self, domain: str, service: str) -> None: ...
380
403
  def async_remove(self, domain: str, service: str) -> None: ...
404
+ def _async_remove(self, domain: str, service: str) -> None: ...
381
405
  def call(self, domain: str, service: str, service_data: dict[str, Any] | None = None, blocking: bool = False, context: Context | None = None, target: dict[str, Any] | None = None, return_response: bool = False) -> ServiceResponse: ...
382
406
  async def async_call(self, domain: str, service: str, service_data: dict[str, Any] | None = None, blocking: bool = False, context: Context | None = None, target: dict[str, Any] | None = None, return_response: bool = False) -> ServiceResponse: ...
383
407
  async def _run_service_call_catch_exceptions(self, coro_or_task: Coroutine[Any, Any, Any] | asyncio.Task[Any], service_call: ServiceCall) -> None: ...
384
408
  async def _execute_service(self, handler: Service, service_call: ServiceCall) -> ServiceResponse: ...
385
409
 
410
+ class _ComponentSet(set[str]):
411
+ _top_level_components: Incomplete
412
+ def __init__(self, top_level_components: set[str]) -> None: ...
413
+ def add(self, component: str) -> None: ...
414
+ def remove(self, component: str) -> None: ...
415
+ def discard(self, component: str) -> None: ...
416
+
386
417
  class Config:
387
418
  _store: Config._ConfigStore
388
419
  hass: Incomplete
389
420
  latitude: int
390
421
  longitude: int
391
422
  elevation: int
423
+ debug: bool
392
424
  location_name: str
393
425
  time_zone: str
394
426
  units: Incomplete
@@ -400,6 +432,7 @@ class Config:
400
432
  config_source: Incomplete
401
433
  skip_pip: bool
402
434
  skip_pip_packages: Incomplete
435
+ top_level_components: Incomplete
403
436
  components: Incomplete
404
437
  api: Incomplete
405
438
  config_dir: Incomplete
@@ -7,7 +7,7 @@ from .helpers.deprecation import DeprecatedConstantEnum as DeprecatedConstantEnu
7
7
  from .helpers.frame import report as report
8
8
  from .loader import async_suggest_report_issue as async_suggest_report_issue
9
9
  from _typeshed import Incomplete
10
- from collections.abc import Callable as Callable, Iterable, Mapping
10
+ from collections.abc import Callable as Callable, Container, Iterable, Mapping
11
11
  from dataclasses import dataclass
12
12
  from enum import StrEnum
13
13
  from typing import Any, Generic, Required, TypedDict
@@ -66,7 +66,7 @@ class FlowResult(TypedDict, Generic[_HandlerT], total=False):
66
66
  flow_id: Required[str]
67
67
  handler: Required[_HandlerT]
68
68
  last_step: bool | None
69
- menu_options: list[str] | dict[str, str]
69
+ menu_options: Container[str]
70
70
  options: Mapping[str, Any]
71
71
  preview: str | None
72
72
  progress_action: str
@@ -139,7 +139,7 @@ class FlowHandler(Generic[_FlowResultT, _HandlerT]):
139
139
  def async_external_step_done(self, *, next_step_id: str) -> _FlowResultT: ...
140
140
  def async_show_progress(self, *, step_id: str | None = None, progress_action: str, description_placeholders: Mapping[str, str] | None = None, progress_task: asyncio.Task[Any] | None = None) -> _FlowResultT: ...
141
141
  def async_show_progress_done(self, *, next_step_id: str) -> _FlowResultT: ...
142
- def async_show_menu(self, *, step_id: str | None = None, menu_options: list[str] | dict[str, str], description_placeholders: Mapping[str, str] | None = None) -> _FlowResultT: ...
142
+ def async_show_menu(self, *, step_id: str | None = None, menu_options: Container[str], description_placeholders: Mapping[str, str] | None = None) -> _FlowResultT: ...
143
143
  def async_remove(self) -> None: ...
144
144
  @staticmethod
145
145
  async def async_setup_preview(hass: HomeAssistant) -> None: ...
@@ -1,7 +1,9 @@
1
1
  from .core import Context as Context
2
+ from .util.event_type import EventType as EventType
2
3
  from _typeshed import Incomplete
3
4
  from collections.abc import Callable as Callable, Generator, Sequence
4
5
  from dataclasses import dataclass
6
+ from typing import Any
5
7
 
6
8
  _function_cache: dict[str, Callable[[str, str, dict[str, str] | None], str]]
7
9
 
@@ -76,7 +78,7 @@ class Unauthorized(HomeAssistantError):
76
78
 
77
79
  class UnknownUser(Unauthorized): ...
78
80
 
79
- class ServiceNotFound(HomeAssistantError):
81
+ class ServiceNotFound(ServiceValidationError):
80
82
  domain: Incomplete
81
83
  service: Incomplete
82
84
  generate_message: bool
@@ -87,7 +89,7 @@ class MaxLengthExceeded(HomeAssistantError):
87
89
  property_name: Incomplete
88
90
  max_length: Incomplete
89
91
  generate_message: bool
90
- def __init__(self, value: str, property_name: str, max_length: int) -> None: ...
92
+ def __init__(self, value: EventType[Any] | str, property_name: str, max_length: int) -> None: ...
91
93
 
92
94
  class DependencyError(HomeAssistantError):
93
95
  failed_dependencies: Incomplete
@@ -1,4 +1,5 @@
1
1
  import aiohttp
2
+ from .backports.aiohttp_resolver import AsyncResolver as AsyncResolver
2
3
  from .frame import warn_use as warn_use
3
4
  from .json import json_dumps as json_dumps
4
5
  from _typeshed import Incomplete
@@ -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: ...