homeassistant-stubs 2024.2.4__py3-none-any.whl → 2024.3.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.
- homeassistant-stubs/bootstrap.pyi +20 -5
- homeassistant-stubs/components/aftership/const.pyi +0 -1
- homeassistant-stubs/components/aftership/sensor.pyi +2 -2
- homeassistant-stubs/components/airthings_ble/config_flow.pyi +1 -0
- homeassistant-stubs/components/airzone_cloud/sensor.pyi +1 -1
- homeassistant-stubs/components/alexa/config.pyi +2 -0
- homeassistant-stubs/components/amberelectric/sensor.pyi +0 -1
- homeassistant-stubs/components/androidtv/entity.pyi +30 -0
- homeassistant-stubs/components/androidtv/media_player.pyi +5 -23
- homeassistant-stubs/components/anthemav/media_player.pyi +0 -1
- homeassistant-stubs/components/api/__init__.pyi +0 -1
- homeassistant-stubs/components/apple_tv/__init__.pyi +68 -0
- homeassistant-stubs/components/apple_tv/browse_media.pyi +5 -0
- homeassistant-stubs/components/apple_tv/config_flow.pyi +63 -0
- homeassistant-stubs/components/apple_tv/const.pyi +4 -0
- homeassistant-stubs/components/apple_tv/media_player.pyi +93 -0
- homeassistant-stubs/components/apple_tv/remote.pyi +23 -0
- homeassistant-stubs/components/assist_pipeline/__init__.pyi +1 -1
- homeassistant-stubs/components/assist_pipeline/const.pyi +1 -1
- homeassistant-stubs/components/assist_pipeline/error.pyi +4 -0
- homeassistant-stubs/components/assist_pipeline/pipeline.pyi +5 -5
- homeassistant-stubs/components/asterisk_mbox/__init__.pyi +1 -0
- homeassistant-stubs/components/asuswrt/router.pyi +1 -1
- homeassistant-stubs/components/auth/__init__.pyi +2 -2
- homeassistant-stubs/components/automation/__init__.pyi +2 -1
- homeassistant-stubs/components/axis/binary_sensor.pyi +4 -0
- homeassistant-stubs/components/backup/manager.pyi +5 -3
- homeassistant-stubs/components/backup/websocket.pyi +4 -2
- homeassistant-stubs/components/blue_current/__init__.pyi +4 -3
- homeassistant-stubs/components/blue_current/entity.pyi +5 -2
- homeassistant-stubs/components/bluetooth/manager.pyi +2 -2
- homeassistant-stubs/components/bluetooth/match.pyi +3 -0
- homeassistant-stubs/components/bmw_connected_drive/device_tracker.pyi +1 -0
- homeassistant-stubs/components/braviatv/coordinator.pyi +2 -0
- homeassistant-stubs/components/braviatv/media_player.pyi +5 -0
- homeassistant-stubs/components/brother/sensor.pyi +3 -3
- homeassistant-stubs/components/bthome/config_flow.pyi +4 -4
- homeassistant-stubs/components/calendar/trigger.pyi +2 -1
- homeassistant-stubs/components/camera/media_source.pyi +1 -0
- homeassistant-stubs/components/camera/prefs.pyi +2 -0
- homeassistant-stubs/components/cert_expiry/sensor.pyi +0 -1
- homeassistant-stubs/components/climate/__init__.pyi +3 -1
- homeassistant-stubs/components/cloud/const.pyi +2 -0
- homeassistant-stubs/components/cloud/google_config.pyi +7 -5
- homeassistant-stubs/components/cloud/http_api.pyi +1 -1
- homeassistant-stubs/components/cloud/prefs.pyi +6 -2
- homeassistant-stubs/components/cloud/tts.pyi +3 -2
- homeassistant-stubs/components/config/area_registry.pyi +1 -1
- homeassistant-stubs/components/config/auth.pyi +2 -2
- homeassistant-stubs/components/config/auth_provider_homeassistant.pyi +2 -2
- homeassistant-stubs/components/config/automation.pyi +2 -2
- homeassistant-stubs/components/config/config_entries.pyi +5 -4
- homeassistant-stubs/components/config/core.pyi +2 -2
- homeassistant-stubs/components/config/device_registry.pyi +1 -1
- homeassistant-stubs/components/config/entity_registry.pyi +1 -1
- homeassistant-stubs/components/config/floor_registry.pyi +12 -0
- homeassistant-stubs/components/config/label_registry.pyi +12 -0
- homeassistant-stubs/components/config/scene.pyi +2 -2
- homeassistant-stubs/components/config/script.pyi +2 -2
- homeassistant-stubs/components/cpuspeed/sensor.pyi +0 -1
- homeassistant-stubs/components/crownstone/light.pyi +1 -1
- homeassistant-stubs/components/deconz/light.pyi +1 -1
- homeassistant-stubs/components/demo/fan.pyi +1 -0
- homeassistant-stubs/components/dhcp/__init__.pyi +24 -32
- homeassistant-stubs/components/dlna_dmr/media_player.pyi +8 -3
- homeassistant-stubs/components/dnsip/sensor.pyi +1 -1
- homeassistant-stubs/components/dunehd/media_player.pyi +5 -2
- homeassistant-stubs/components/ecovacs/binary_sensor.pyi +3 -3
- homeassistant-stubs/components/ecovacs/button.pyi +5 -5
- homeassistant-stubs/components/ecovacs/controller.pyi +6 -3
- homeassistant-stubs/components/ecovacs/entity.pyi +11 -9
- homeassistant-stubs/components/ecovacs/image.pyi +2 -2
- homeassistant-stubs/components/ecovacs/lawn_mower.pyi +28 -0
- homeassistant-stubs/components/ecovacs/number.pyi +3 -3
- homeassistant-stubs/components/ecovacs/select.pyi +3 -3
- homeassistant-stubs/components/ecovacs/sensor.pyi +6 -6
- homeassistant-stubs/components/ecovacs/switch.pyi +4 -4
- homeassistant-stubs/components/ecovacs/vacuum.pyi +3 -3
- homeassistant-stubs/components/emulated_hue/config.pyi +1 -1
- homeassistant-stubs/components/enphase_envoy/sensor.pyi +39 -4
- homeassistant-stubs/components/esphome/bluetooth.pyi +1 -1
- homeassistant-stubs/components/esphome/camera.pyi +2 -2
- homeassistant-stubs/components/esphome/entry_data.pyi +3 -5
- homeassistant-stubs/components/esphome/manager.pyi +6 -7
- homeassistant-stubs/components/esphome/sensor.pyi +4 -2
- homeassistant-stubs/components/esphome/update.pyi +0 -1
- homeassistant-stubs/components/esphome/voice_assistant.pyi +1 -1
- homeassistant-stubs/components/fastdotcom/sensor.pyi +0 -1
- homeassistant-stubs/components/filesize/sensor.pyi +0 -1
- homeassistant-stubs/components/flexit_bacnet/climate.pyi +4 -2
- homeassistant-stubs/components/flexit_bacnet/number.pyi +31 -0
- homeassistant-stubs/components/flux_led/__init__.pyi +2 -2
- homeassistant-stubs/components/fritz/common.pyi +2 -1
- homeassistant-stubs/components/fully_kiosk/media_player.pyi +2 -1
- homeassistant-stubs/components/generic_thermostat/climate.pyi +1 -1
- homeassistant-stubs/components/goalzero/__init__.pyi +1 -0
- homeassistant-stubs/components/gpsd/sensor.pyi +15 -9
- homeassistant-stubs/components/group/__init__.pyi +1 -1
- homeassistant-stubs/components/group/light.pyi +3 -3
- homeassistant-stubs/components/hardkernel/__init__.pyi +1 -1
- homeassistant-stubs/components/hardware/hardware.pyi +2 -2
- homeassistant-stubs/components/hardware/websocket_api.pyi +1 -1
- homeassistant-stubs/components/homeassistant_green/__init__.pyi +1 -1
- homeassistant-stubs/components/homeassistant_sky_connect/__init__.pyi +2 -1
- homeassistant-stubs/components/homeassistant_yellow/__init__.pyi +3 -2
- homeassistant-stubs/components/homekit/__init__.pyi +1 -1
- homeassistant-stubs/components/homekit/accessories.pyi +1 -1
- homeassistant-stubs/components/homekit/config_flow.pyi +13 -4
- homeassistant-stubs/components/homekit/type_cameras.pyi +1 -1
- homeassistant-stubs/components/homekit/type_covers.pyi +1 -1
- homeassistant-stubs/components/homekit/type_humidifiers.pyi +1 -1
- homeassistant-stubs/components/homekit/type_triggers.pyi +3 -1
- homeassistant-stubs/components/homekit_controller/__init__.pyi +1 -0
- homeassistant-stubs/components/homekit_controller/alarm_control_panel.pyi +0 -1
- homeassistant-stubs/components/homekit_controller/button.pyi +8 -4
- homeassistant-stubs/components/homekit_controller/utils.pyi +4 -0
- homeassistant-stubs/components/http/__init__.pyi +3 -3
- homeassistant-stubs/components/http/auth.pyi +1 -1
- homeassistant-stubs/components/http/ban.pyi +0 -1
- homeassistant-stubs/components/http/const.pyi +1 -1
- homeassistant-stubs/components/http/request_context.pyi +1 -2
- homeassistant-stubs/components/http/view.pyi +1 -29
- homeassistant-stubs/components/huawei_lte/binary_sensor.pyi +0 -6
- homeassistant-stubs/components/huawei_lte/switch.pyi +0 -4
- homeassistant-stubs/components/idasen_desk/sensor.pyi +2 -1
- homeassistant-stubs/components/image/__init__.pyi +13 -3
- homeassistant-stubs/components/image/media_source.pyi +18 -0
- homeassistant-stubs/components/imap/coordinator.pyi +8 -0
- homeassistant-stubs/components/imap/diagnostics.pyi +13 -0
- homeassistant-stubs/components/intent/__init__.pyi +7 -2
- homeassistant-stubs/components/islamic_prayer_times/config_flow.pyi +1 -1
- homeassistant-stubs/components/knx/config_flow.pyi +1 -1
- homeassistant-stubs/components/knx/schema.pyi +3 -18
- homeassistant-stubs/components/knx/validation.pyi +19 -0
- homeassistant-stubs/components/lamarzocco/calendar.pyi +21 -0
- homeassistant-stubs/components/lamarzocco/entity.pyi +7 -4
- homeassistant-stubs/components/lamarzocco/number.pyi +26 -1
- homeassistant-stubs/components/light/__init__.pyi +3 -0
- homeassistant-stubs/components/local_todo/todo.pyi +3 -1
- homeassistant-stubs/components/logbook/__init__.pyi +1 -1
- homeassistant-stubs/components/logbook/helpers.pyi +2 -2
- homeassistant-stubs/components/logbook/models.pyi +2 -2
- homeassistant-stubs/components/mailbox/__init__.pyi +1 -0
- homeassistant-stubs/components/matter/light.pyi +6 -5
- homeassistant-stubs/components/media_player/intent.pyi +11 -0
- homeassistant-stubs/components/minecraft_server/__init__.pyi +1 -1
- homeassistant-stubs/components/modbus/__init__.pyi +1 -1
- homeassistant-stubs/components/modbus/climate.pyi +1 -0
- homeassistant-stubs/components/modbus/validators.pyi +4 -4
- homeassistant-stubs/components/mqtt/__init__.pyi +3 -3
- homeassistant-stubs/components/mqtt/climate.pyi +1 -8
- homeassistant-stubs/components/mqtt/const.pyi +2 -0
- homeassistant-stubs/components/mqtt/event.pyi +1 -1
- homeassistant-stubs/components/mqtt/image.pyi +1 -1
- homeassistant-stubs/components/mqtt/mixins.pyi +2 -2
- homeassistant-stubs/components/mqtt/models.pyi +10 -0
- homeassistant-stubs/components/mqtt/tag.pyi +1 -1
- homeassistant-stubs/components/myuplink/__init__.pyi +2 -1
- homeassistant-stubs/components/myuplink/binary_sensor.pyi +24 -0
- homeassistant-stubs/components/myuplink/config_flow.pyi +7 -0
- homeassistant-stubs/components/myuplink/coordinator.pyi +1 -2
- homeassistant-stubs/components/myuplink/diagnostics.pyi +11 -0
- homeassistant-stubs/components/myuplink/helpers.pyi +6 -0
- homeassistant-stubs/components/myuplink/number.pyi +30 -0
- homeassistant-stubs/components/myuplink/sensor.pyi +20 -3
- homeassistant-stubs/components/myuplink/switch.pyi +29 -0
- homeassistant-stubs/components/myuplink/update.pyi +20 -0
- homeassistant-stubs/components/notion/__init__.pyi +10 -6
- homeassistant-stubs/components/notion/config_flow.pyi +11 -3
- homeassistant-stubs/components/notion/const.pyi +2 -0
- homeassistant-stubs/components/notion/diagnostics.pyi +2 -2
- homeassistant-stubs/components/notion/model.pyi +1 -1
- homeassistant-stubs/components/notion/util.pyi +7 -0
- homeassistant-stubs/components/overkiz/climate.pyi +1 -1
- homeassistant-stubs/components/overkiz/climate_entities/__init__.pyi +8 -0
- homeassistant-stubs/components/overkiz/climate_entities/atlantic_pass_apc_heating_zone.pyi +1 -1
- homeassistant-stubs/components/overkiz/climate_entities/atlantic_pass_apc_zone_control.pyi +5 -1
- homeassistant-stubs/components/overkiz/climate_entities/atlantic_pass_apc_zone_control_zone.pyi +33 -0
- homeassistant-stubs/components/overkiz/climate_entities/hitachi_air_to_air_heat_pump_ovp.pyi +61 -0
- homeassistant-stubs/components/overkiz/number.pyi +7 -1
- homeassistant-stubs/components/proximity/config_flow.pyi +1 -1
- homeassistant-stubs/components/rainmachine/util.pyi +1 -1
- homeassistant-stubs/components/raspberry_pi/__init__.pyi +1 -1
- homeassistant-stubs/components/recorder/__init__.pyi +1 -1
- homeassistant-stubs/components/recorder/core.pyi +1 -0
- homeassistant-stubs/components/recorder/websocket_api.pyi +1 -5
- homeassistant-stubs/components/repairs/issue_handler.pyi +1 -1
- homeassistant-stubs/components/rfxtrx/__init__.pyi +3 -1
- homeassistant-stubs/components/samsungtv/__init__.pyi +1 -1
- homeassistant-stubs/components/samsungtv/config_flow.pyi +1 -0
- homeassistant-stubs/components/sensor/recorder.pyi +0 -2
- homeassistant-stubs/components/shelly/binary_sensor.pyi +1 -1
- homeassistant-stubs/components/shelly/button.pyi +1 -1
- homeassistant-stubs/components/shelly/climate.pyi +1 -3
- homeassistant-stubs/components/shelly/entity.pyi +1 -2
- homeassistant-stubs/components/shelly/number.pyi +1 -1
- homeassistant-stubs/components/shelly/sensor.pyi +2 -2
- homeassistant-stubs/components/shelly/switch.pyi +4 -5
- homeassistant-stubs/components/shelly/utils.pyi +2 -0
- homeassistant-stubs/components/shelly/valve.pyi +1 -1
- homeassistant-stubs/components/ssdp/__init__.pyi +1 -0
- homeassistant-stubs/components/statistics/sensor.pyi +4 -1
- homeassistant-stubs/components/steamist/__init__.pyi +1 -1
- homeassistant-stubs/components/system_health/__init__.pyi +1 -1
- homeassistant-stubs/components/systemmonitor/__init__.pyi +3 -0
- homeassistant-stubs/components/systemmonitor/binary_sensor.pyi +48 -0
- homeassistant-stubs/components/systemmonitor/config_flow.pyi +2 -0
- homeassistant-stubs/components/systemmonitor/const.pyi +1 -0
- homeassistant-stubs/components/systemmonitor/coordinator.pyi +14 -10
- homeassistant-stubs/components/systemmonitor/diagnostics.pyi +7 -0
- homeassistant-stubs/components/systemmonitor/repairs.pyi +15 -0
- homeassistant-stubs/components/systemmonitor/sensor.pyi +5 -4
- homeassistant-stubs/components/systemmonitor/util.pyi +6 -5
- homeassistant-stubs/components/technove/helpers.pyi +9 -0
- homeassistant-stubs/components/technove/switch.pyi +33 -0
- homeassistant-stubs/components/tedee/config_flow.pyi +1 -0
- homeassistant-stubs/components/tedee/sensor.pyi +1 -1
- homeassistant-stubs/components/tibber/sensor.pyi +7 -4
- homeassistant-stubs/components/tplink/__init__.pyi +1 -1
- homeassistant-stubs/components/tplink/config_flow.pyi +2 -2
- homeassistant-stubs/components/tplink/light.pyi +1 -0
- homeassistant-stubs/components/tplink_omada/binary_sensor.pyi +2 -2
- homeassistant-stubs/components/tplink_omada/config_flow.pyi +1 -1
- homeassistant-stubs/components/tplink_omada/controller.pyi +1 -1
- homeassistant-stubs/components/tplink_omada/coordinator.pyi +1 -1
- homeassistant-stubs/components/tplink_omada/update.pyi +1 -1
- homeassistant-stubs/components/tractive/device_tracker.pyi +0 -1
- homeassistant-stubs/components/unifi/__init__.pyi +1 -1
- homeassistant-stubs/components/unifi/button.pyi +1 -1
- homeassistant-stubs/components/unifi/config_flow.pyi +2 -2
- homeassistant-stubs/components/unifi/device_tracker.pyi +6 -6
- homeassistant-stubs/components/unifi/diagnostics.pyi +1 -1
- homeassistant-stubs/components/unifi/entity.pyi +13 -13
- homeassistant-stubs/components/unifi/hub/__init__.pyi +2 -0
- homeassistant-stubs/components/unifi/hub/api.pyi +10 -0
- homeassistant-stubs/components/unifi/{controller.pyi → hub/hub.pyi} +9 -19
- homeassistant-stubs/components/unifi/hub/websocket.pyi +25 -0
- homeassistant-stubs/components/unifi/image.pyi +4 -4
- homeassistant-stubs/components/unifi/sensor.pyi +14 -14
- homeassistant-stubs/components/unifi/switch.pyi +14 -14
- homeassistant-stubs/components/unifi/update.pyi +1 -1
- homeassistant-stubs/components/unifiprotect/__init__.pyi +4 -2
- homeassistant-stubs/components/unifiprotect/const.pyi +1 -0
- homeassistant-stubs/components/unifiprotect/data.pyi +3 -2
- homeassistant-stubs/components/unifiprotect/media_source.pyi +6 -3
- homeassistant-stubs/components/unifiprotect/migrate.pyi +3 -5
- homeassistant-stubs/components/unifiprotect/repairs.pyi +8 -2
- homeassistant-stubs/components/usb/__init__.pyi +1 -1
- homeassistant-stubs/components/vacuum/intent.pyi +8 -0
- homeassistant-stubs/components/vallox/__init__.pyi +5 -23
- homeassistant-stubs/components/vallox/fan.pyi +1 -1
- homeassistant-stubs/components/wake_word/models.pyi +4 -2
- homeassistant-stubs/components/water_heater/__init__.pyi +2 -0
- homeassistant-stubs/components/websocket_api/connection.pyi +1 -1
- homeassistant-stubs/components/websocket_api/http.pyi +1 -0
- homeassistant-stubs/components/wiz/light.pyi +3 -2
- homeassistant-stubs/components/xiaomi_ble/const.pyi +9 -0
- homeassistant-stubs/components/xiaomi_ble/device_trigger.pyi +1 -1
- homeassistant-stubs/components/xiaomi_ble/event.pyi +1 -1
- homeassistant-stubs/components/yalexs_ble/__init__.pyi +1 -1
- homeassistant-stubs/components/yalexs_ble/config_flow.pyi +1 -1
- homeassistant-stubs/components/zwave_js/climate.pyi +4 -0
- homeassistant-stubs/components/zwave_js/sensor.pyi +0 -1
- homeassistant-stubs/config.pyi +4 -2
- homeassistant-stubs/config_entries.pyi +40 -26
- homeassistant-stubs/const.pyi +1 -0
- homeassistant-stubs/core.pyi +11 -7
- homeassistant-stubs/data_entry_flow.pyi +1 -0
- homeassistant-stubs/helpers/area_registry.pyi +9 -4
- homeassistant-stubs/helpers/collection.pyi +19 -0
- homeassistant-stubs/helpers/config_validation.pyi +5 -0
- homeassistant-stubs/helpers/data_entry_flow.pyi +2 -1
- homeassistant-stubs/helpers/debounce.pyi +3 -1
- homeassistant-stubs/helpers/device_registry.pyi +13 -6
- homeassistant-stubs/helpers/entity.pyi +4 -2
- homeassistant-stubs/helpers/entity_component.pyi +1 -1
- homeassistant-stubs/helpers/entity_platform.pyi +7 -3
- homeassistant-stubs/helpers/entity_registry.pyi +10 -4
- homeassistant-stubs/helpers/event.pyi +28 -2
- homeassistant-stubs/helpers/floor_registry.pyi +59 -0
- homeassistant-stubs/helpers/frame.pyi +3 -1
- homeassistant-stubs/helpers/http.pyi +32 -0
- homeassistant-stubs/helpers/icon.pyi +1 -1
- homeassistant-stubs/helpers/integration_platform.pyi +12 -8
- homeassistant-stubs/helpers/intent.pyi +20 -6
- homeassistant-stubs/helpers/json.pyi +1 -0
- homeassistant-stubs/helpers/label_registry.pyi +59 -0
- homeassistant-stubs/helpers/redact.pyi +13 -0
- homeassistant-stubs/helpers/service.pyi +1 -0
- homeassistant-stubs/helpers/storage.pyi +7 -3
- homeassistant-stubs/helpers/template.pyi +7 -0
- homeassistant-stubs/helpers/translation.pyi +18 -4
- homeassistant-stubs/helpers/update_coordinator.pyi +1 -0
- homeassistant-stubs/loader.pyi +35 -13
- homeassistant-stubs/setup.pyi +9 -3
- homeassistant-stubs/util/async_.pyi +3 -3
- homeassistant-stubs/util/file.pyi +2 -2
- homeassistant-stubs/util/yaml/loader.pyi +3 -0
- {homeassistant_stubs-2024.2.4.dist-info → homeassistant_stubs-2024.3.0.dist-info}/METADATA +2 -2
- {homeassistant_stubs-2024.2.4.dist-info → homeassistant_stubs-2024.3.0.dist-info}/RECORD +302 -264
- {homeassistant_stubs-2024.2.4.dist-info → homeassistant_stubs-2024.3.0.dist-info}/LICENSE +0 -0
- {homeassistant_stubs-2024.2.4.dist-info → homeassistant_stubs-2024.3.0.dist-info}/WHEEL +0 -0
@@ -15,7 +15,7 @@ from homeassistant.core import CALLBACK_TYPE as CALLBACK_TYPE, HassJob as HassJo
|
|
15
15
|
from homeassistant.exceptions import TemplateError as TemplateError
|
16
16
|
from homeassistant.loader import bind_hass as bind_hass
|
17
17
|
from homeassistant.util.async_ import run_callback_threadsafe as run_callback_threadsafe
|
18
|
-
from typing import Any, Concatenate, ParamSpec, TypeVar, TypedDict
|
18
|
+
from typing import Any, Concatenate, Generic, ParamSpec, TypeVar, TypedDict
|
19
19
|
|
20
20
|
TRACK_STATE_CHANGE_CALLBACKS: str
|
21
21
|
TRACK_STATE_CHANGE_LISTENER: str
|
@@ -36,6 +36,16 @@ RANDOM_MICROSECOND_MAX: int
|
|
36
36
|
_TypedDictT = TypeVar('_TypedDictT', bound=Mapping[str, Any])
|
37
37
|
_P = ParamSpec('_P')
|
38
38
|
|
39
|
+
@dataclass(slots=True, frozen=True)
|
40
|
+
class _KeyedEventTracker(Generic[_TypedDictT]):
|
41
|
+
listeners_key: str
|
42
|
+
callbacks_key: str
|
43
|
+
event_type: str
|
44
|
+
dispatcher_callable: Callable[[HomeAssistant, dict[str, list[HassJob[[EventType[_TypedDictT]], Any]]], EventType[_TypedDictT]], None]
|
45
|
+
filter_callable: Callable[[HomeAssistant, dict[str, list[HassJob[[EventType[_TypedDictT]], Any]]], EventType[_TypedDictT]], bool]
|
46
|
+
run_immediately: bool
|
47
|
+
def __init__(self, listeners_key, callbacks_key, event_type, dispatcher_callable, filter_callable, run_immediately) -> None: ...
|
48
|
+
|
39
49
|
@dataclass(slots=True)
|
40
50
|
class TrackStates:
|
41
51
|
all_states: bool
|
@@ -70,21 +80,36 @@ track_state_change: Incomplete
|
|
70
80
|
def async_track_state_change_event(hass: HomeAssistant, entity_ids: str | Iterable[str], action: Callable[[EventType[EventStateChangedData]], Any]) -> CALLBACK_TYPE: ...
|
71
81
|
def _async_dispatch_entity_id_event(hass: HomeAssistant, callbacks: dict[str, list[HassJob[[EventType[EventStateChangedData]], Any]]], event: EventType[EventStateChangedData]) -> None: ...
|
72
82
|
def _async_state_change_filter(hass: HomeAssistant, callbacks: dict[str, list[HassJob[[EventType[EventStateChangedData]], Any]]], event: EventType[EventStateChangedData]) -> bool: ...
|
83
|
+
|
84
|
+
_KEYED_TRACK_STATE_CHANGE: Incomplete
|
85
|
+
|
73
86
|
def _async_track_state_change_event(hass: HomeAssistant, entity_ids: str | Iterable[str], action: Callable[[EventType[EventStateChangedData]], Any]) -> CALLBACK_TYPE: ...
|
74
87
|
def _remove_empty_listener() -> None: ...
|
75
88
|
def _remove_listener(hass: HomeAssistant, listeners_key: str, keys: Iterable[str], job: HassJob[[EventType[_TypedDictT]], Any], callbacks: dict[str, list[HassJob[[EventType[_TypedDictT]], Any]]]) -> None: ...
|
76
|
-
def _async_track_event(
|
89
|
+
def _async_track_event(tracker: _KeyedEventTracker[_TypedDictT], hass: HomeAssistant, keys: str | Iterable[str], action: Callable[[EventType[_TypedDictT]], None]) -> CALLBACK_TYPE: ...
|
77
90
|
def _async_dispatch_old_entity_id_or_entity_id_event(hass: HomeAssistant, callbacks: dict[str, list[HassJob[[EventType[EventEntityRegistryUpdatedData]], Any]]], event: EventType[EventEntityRegistryUpdatedData]) -> None: ...
|
78
91
|
def _async_entity_registry_updated_filter(hass: HomeAssistant, callbacks: dict[str, list[HassJob[[EventType[EventEntityRegistryUpdatedData]], Any]]], event: EventType[EventEntityRegistryUpdatedData]) -> bool: ...
|
92
|
+
|
93
|
+
_KEYED_TRACK_ENTITY_REGISTRY_UPDATED: Incomplete
|
94
|
+
|
79
95
|
def async_track_entity_registry_updated_event(hass: HomeAssistant, entity_ids: str | Iterable[str], action: Callable[[EventType[EventEntityRegistryUpdatedData]], Any]) -> CALLBACK_TYPE: ...
|
80
96
|
def _async_device_registry_updated_filter(hass: HomeAssistant, callbacks: dict[str, list[HassJob[[EventType[EventDeviceRegistryUpdatedData]], Any]]], event: EventType[EventDeviceRegistryUpdatedData]) -> bool: ...
|
81
97
|
def _async_dispatch_device_id_event(hass: HomeAssistant, callbacks: dict[str, list[HassJob[[EventType[EventDeviceRegistryUpdatedData]], Any]]], event: EventType[EventDeviceRegistryUpdatedData]) -> None: ...
|
98
|
+
|
99
|
+
_KEYED_TRACK_DEVICE_REGISTRY_UPDATED: Incomplete
|
100
|
+
|
82
101
|
def async_track_device_registry_updated_event(hass: HomeAssistant, device_ids: str | Iterable[str], action: Callable[[EventType[EventDeviceRegistryUpdatedData]], Any]) -> CALLBACK_TYPE: ...
|
83
102
|
def _async_dispatch_domain_event(hass: HomeAssistant, callbacks: dict[str, list[HassJob[[EventType[EventStateChangedData]], Any]]], event: EventType[EventStateChangedData]) -> None: ...
|
84
103
|
def _async_domain_added_filter(hass: HomeAssistant, callbacks: dict[str, list[HassJob[[EventType[EventStateChangedData]], Any]]], event: EventType[EventStateChangedData]) -> bool: ...
|
85
104
|
def async_track_state_added_domain(hass: HomeAssistant, domains: str | Iterable[str], action: Callable[[EventType[EventStateChangedData]], Any]) -> CALLBACK_TYPE: ...
|
105
|
+
|
106
|
+
_KEYED_TRACK_STATE_ADDED_DOMAIN: Incomplete
|
107
|
+
|
86
108
|
def _async_track_state_added_domain(hass: HomeAssistant, domains: str | Iterable[str], action: Callable[[EventType[EventStateChangedData]], Any]) -> CALLBACK_TYPE: ...
|
87
109
|
def _async_domain_removed_filter(hass: HomeAssistant, callbacks: dict[str, list[HassJob[[EventType[EventStateChangedData]], Any]]], event: EventType[EventStateChangedData]) -> bool: ...
|
110
|
+
|
111
|
+
_KEYED_TRACK_STATE_REMOVED_DOMAIN: Incomplete
|
112
|
+
|
88
113
|
def async_track_state_removed_domain(hass: HomeAssistant, domains: str | Iterable[str], action: Callable[[EventType[EventStateChangedData]], Any]) -> CALLBACK_TYPE: ...
|
89
114
|
def _async_string_to_lower_list(instr: str | Iterable[str]) -> list[str]: ...
|
90
115
|
|
@@ -133,6 +158,7 @@ class TrackTemplateResultInfo:
|
|
133
158
|
def _render_template_if_ready(self, track_template_: TrackTemplate, now: datetime, event: EventType[EventStateChangedData] | None) -> bool | TrackTemplateResult: ...
|
134
159
|
@staticmethod
|
135
160
|
def _super_template_as_boolean(result: bool | str | TemplateError) -> bool: ...
|
161
|
+
def _apply_update(self, updates: list[TrackTemplateResult], update: bool | TrackTemplateResult, template: Template) -> bool: ...
|
136
162
|
def _refresh(self, event: EventType[EventStateChangedData] | None, track_templates: Iterable[TrackTemplate] | None = None, replayed: bool | None = False) -> None: ...
|
137
163
|
|
138
164
|
TrackTemplateResultListener: Incomplete
|
@@ -0,0 +1,59 @@
|
|
1
|
+
from .storage import Store as Store
|
2
|
+
from .typing import EventType as EventType, UNDEFINED as UNDEFINED, UndefinedType as UndefinedType
|
3
|
+
from _typeshed import Incomplete
|
4
|
+
from collections import UserDict
|
5
|
+
from collections.abc import Iterable, ValuesView
|
6
|
+
from dataclasses import dataclass
|
7
|
+
from homeassistant.core import HomeAssistant as HomeAssistant, callback as callback
|
8
|
+
from homeassistant.util import slugify as slugify
|
9
|
+
from typing import Literal, TypedDict
|
10
|
+
|
11
|
+
DATA_REGISTRY: str
|
12
|
+
EVENT_FLOOR_REGISTRY_UPDATED: str
|
13
|
+
STORAGE_KEY: str
|
14
|
+
STORAGE_VERSION_MAJOR: int
|
15
|
+
SAVE_DELAY: int
|
16
|
+
|
17
|
+
class EventFloorRegistryUpdatedData(TypedDict):
|
18
|
+
action: Literal['create', 'remove', 'update']
|
19
|
+
floor_id: str
|
20
|
+
EventFloorRegistryUpdated = EventType[EventFloorRegistryUpdatedData]
|
21
|
+
|
22
|
+
@dataclass(slots=True, kw_only=True, frozen=True)
|
23
|
+
class FloorEntry:
|
24
|
+
aliases: set[str]
|
25
|
+
floor_id: str
|
26
|
+
icon: str | None = ...
|
27
|
+
level: int = ...
|
28
|
+
name: str
|
29
|
+
normalized_name: str
|
30
|
+
def __init__(self, *, aliases, floor_id, icon, level, name, normalized_name) -> None: ...
|
31
|
+
|
32
|
+
class FloorRegistryItems(UserDict[str, FloorEntry]):
|
33
|
+
_normalized_names: Incomplete
|
34
|
+
def __init__(self) -> None: ...
|
35
|
+
def values(self) -> ValuesView[FloorEntry]: ...
|
36
|
+
def __setitem__(self, key: str, entry: FloorEntry) -> None: ...
|
37
|
+
def __delitem__(self, key: str) -> None: ...
|
38
|
+
def get_floor_by_name(self, name: str) -> FloorEntry | None: ...
|
39
|
+
|
40
|
+
class FloorRegistry:
|
41
|
+
floors: FloorRegistryItems
|
42
|
+
_floor_data: dict[str, FloorEntry]
|
43
|
+
hass: Incomplete
|
44
|
+
_store: Incomplete
|
45
|
+
def __init__(self, hass: HomeAssistant) -> None: ...
|
46
|
+
def async_get_floor(self, floor_id: str) -> FloorEntry | None: ...
|
47
|
+
def async_get_floor_by_name(self, name: str) -> FloorEntry | None: ...
|
48
|
+
def async_list_floors(self) -> Iterable[FloorEntry]: ...
|
49
|
+
def _generate_id(self, name: str) -> str: ...
|
50
|
+
def async_create(self, name: str, *, aliases: set[str] | None = None, icon: str | None = None, level: int = 0) -> FloorEntry: ...
|
51
|
+
def async_delete(self, floor_id: str) -> None: ...
|
52
|
+
def async_update(self, floor_id: str, *, aliases: set[str] | UndefinedType = ..., icon: str | None | UndefinedType = ..., level: int | UndefinedType = ..., name: str | UndefinedType = ...) -> FloorEntry: ...
|
53
|
+
async def async_load(self) -> None: ...
|
54
|
+
def async_schedule_save(self) -> None: ...
|
55
|
+
def _data_to_save(self) -> dict[str, list[dict[str, str | int | list[str] | None]]]: ...
|
56
|
+
|
57
|
+
def async_get(hass: HomeAssistant) -> FloorRegistry: ...
|
58
|
+
async def async_load(hass: HomeAssistant) -> None: ...
|
59
|
+
def _normalize_floor_name(floor_name: str) -> str: ...
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import logging
|
1
2
|
from _typeshed import Incomplete
|
2
3
|
from collections.abc import Callable
|
3
4
|
from dataclasses import dataclass
|
@@ -20,10 +21,11 @@ class IntegrationFrame:
|
|
20
21
|
relative_filename: str
|
21
22
|
def __init__(self, *, custom_integration, frame, integration, module, relative_filename) -> None: ...
|
22
23
|
|
24
|
+
def get_integration_logger(fallback_name: str) -> logging.Logger: ...
|
23
25
|
def get_integration_frame(exclude_integrations: set | None = None) -> IntegrationFrame: ...
|
24
26
|
|
25
27
|
class MissingIntegrationFrame(HomeAssistantError): ...
|
26
28
|
|
27
|
-
def report(what: str, exclude_integrations: set | None = None, error_if_core: bool = True, level: int =
|
29
|
+
def report(what: str, exclude_integrations: set | None = None, error_if_core: bool = True, level: int = ..., log_custom_component_only: bool = False) -> None: ...
|
28
30
|
def _report_integration(what: str, integration_frame: IntegrationFrame, level: int = ...) -> None: ...
|
29
31
|
def warn_use(func: _CallableT, what: str) -> _CallableT: ...
|
@@ -0,0 +1,32 @@
|
|
1
|
+
from .json import find_paths_unserializable_data as find_paths_unserializable_data, json_bytes as json_bytes, json_dumps as json_dumps
|
2
|
+
from _typeshed import Incomplete
|
3
|
+
from aiohttp import web
|
4
|
+
from aiohttp.typedefs import LooseHeaders as LooseHeaders
|
5
|
+
from aiohttp.web import Request as Request
|
6
|
+
from aiohttp.web_urldispatcher import AbstractRoute as AbstractRoute
|
7
|
+
from collections.abc import Awaitable, Callable as Callable
|
8
|
+
from contextvars import ContextVar
|
9
|
+
from homeassistant import exceptions as exceptions
|
10
|
+
from homeassistant.const import CONTENT_TYPE_JSON as CONTENT_TYPE_JSON
|
11
|
+
from homeassistant.core import Context as Context, HomeAssistant as HomeAssistant, is_callback as is_callback
|
12
|
+
from homeassistant.util.json import JSON_ENCODE_EXCEPTIONS as JSON_ENCODE_EXCEPTIONS, format_unserializable_data as format_unserializable_data
|
13
|
+
from http import HTTPStatus
|
14
|
+
from typing import Any, Final
|
15
|
+
|
16
|
+
_LOGGER: Incomplete
|
17
|
+
KEY_AUTHENTICATED: Final[str]
|
18
|
+
current_request: ContextVar[Request | None]
|
19
|
+
|
20
|
+
def request_handler_factory(hass: HomeAssistant, view: HomeAssistantView, handler: Callable) -> Callable[[web.Request], Awaitable[web.StreamResponse]]: ...
|
21
|
+
|
22
|
+
class HomeAssistantView:
|
23
|
+
url: str | None
|
24
|
+
extra_urls: list[str]
|
25
|
+
requires_auth: bool
|
26
|
+
cors_allowed: bool
|
27
|
+
@staticmethod
|
28
|
+
def context(request: web.Request) -> Context: ...
|
29
|
+
@staticmethod
|
30
|
+
def json(result: Any, status_code: HTTPStatus | int = ..., headers: LooseHeaders | None = None) -> web.Response: ...
|
31
|
+
def json_message(self, message: str, status_code: HTTPStatus | int = ..., message_code: str | None = None, headers: LooseHeaders | None = None) -> web.Response: ...
|
32
|
+
def register(self, hass: HomeAssistant, app: web.Application, router: web.UrlDispatcher) -> None: ...
|
@@ -6,7 +6,6 @@ from homeassistant.loader import Integration as Integration, async_get_integrati
|
|
6
6
|
from homeassistant.util.json import load_json_object as load_json_object
|
7
7
|
from typing import Any
|
8
8
|
|
9
|
-
ICON_LOAD_LOCK: str
|
10
9
|
ICON_CACHE: str
|
11
10
|
_LOGGER: Incomplete
|
12
11
|
|
@@ -19,6 +18,7 @@ class _IconsCache:
|
|
19
18
|
_hass: Incomplete
|
20
19
|
_loaded: Incomplete
|
21
20
|
_cache: Incomplete
|
21
|
+
_lock: Incomplete
|
22
22
|
def __init__(self, hass: HomeAssistant) -> None: ...
|
23
23
|
async def async_fetch(self, category: str, components: set[str]) -> dict[str, dict[str, Any]]: ...
|
24
24
|
async def _async_load(self, components: set[str]) -> None: ...
|
@@ -1,10 +1,13 @@
|
|
1
|
+
from .typing import EventType as EventType
|
1
2
|
from _typeshed import Incomplete
|
2
3
|
from collections.abc import Awaitable, Callable as Callable
|
3
4
|
from dataclasses import dataclass
|
4
5
|
from homeassistant.const import EVENT_COMPONENT_LOADED as EVENT_COMPONENT_LOADED
|
5
|
-
from homeassistant.core import
|
6
|
-
from homeassistant.loader import Integration as Integration, async_get_integrations as async_get_integrations, bind_hass as bind_hass
|
7
|
-
from homeassistant.setup import ATTR_COMPONENT as ATTR_COMPONENT
|
6
|
+
from homeassistant.core import HassJob as HassJob, HomeAssistant as HomeAssistant, callback as callback
|
7
|
+
from homeassistant.loader import Integration as Integration, async_get_integrations as async_get_integrations, async_get_loaded_integration as async_get_loaded_integration, bind_hass as bind_hass
|
8
|
+
from homeassistant.setup import ATTR_COMPONENT as ATTR_COMPONENT, EventComponentLoaded as EventComponentLoaded
|
9
|
+
from homeassistant.util.logging import catch_log_exception as catch_log_exception
|
10
|
+
from types import ModuleType
|
8
11
|
from typing import Any
|
9
12
|
|
10
13
|
_LOGGER: Incomplete
|
@@ -13,10 +16,11 @@ DATA_INTEGRATION_PLATFORMS: str
|
|
13
16
|
@dataclass(slots=True, frozen=True)
|
14
17
|
class IntegrationPlatform:
|
15
18
|
platform_name: str
|
16
|
-
|
19
|
+
process_job: HassJob[[HomeAssistant, str, Any], Awaitable[None] | None]
|
17
20
|
seen_components: set[str]
|
18
|
-
def __init__(self, platform_name,
|
21
|
+
def __init__(self, platform_name, process_job, seen_components) -> None: ...
|
19
22
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
def _get_platform(integration: Integration | Exception, component_name: str, platform_name: str) -> ModuleType | None: ...
|
24
|
+
def _async_process_integration_platforms_for_component(hass: HomeAssistant, integration_platforms: list[IntegrationPlatform], event: EventType[EventComponentLoaded]) -> None: ...
|
25
|
+
def _format_err(name: str, platform_name: str, *args: Any) -> str: ...
|
26
|
+
async def async_process_integration_platforms(hass: HomeAssistant, platform_name: str, process_platform: Callable[[HomeAssistant, str, Any], Awaitable[None] | None]) -> None: ...
|
@@ -1,10 +1,13 @@
|
|
1
|
+
import abc
|
1
2
|
import asyncio
|
2
3
|
import voluptuous as vol
|
3
4
|
from . import area_registry as area_registry, device_registry as device_registry, entity_registry as entity_registry
|
4
5
|
from _typeshed import Incomplete
|
6
|
+
from abc import abstractmethod
|
5
7
|
from collections.abc import Collection, Iterable
|
6
8
|
from dataclasses import dataclass
|
7
9
|
from enum import Enum
|
10
|
+
from functools import cached_property as cached_property
|
8
11
|
from homeassistant.components.homeassistant.exposed_entities import async_should_expose as async_should_expose
|
9
12
|
from homeassistant.const import ATTR_DEVICE_CLASS as ATTR_DEVICE_CLASS, ATTR_ENTITY_ID as ATTR_ENTITY_ID, ATTR_SUPPORTED_FEATURES as ATTR_SUPPORTED_FEATURES
|
10
13
|
from homeassistant.core import Context as Context, HomeAssistant as HomeAssistant, State as State, callback as callback
|
@@ -20,6 +23,7 @@ INTENT_TURN_ON: str
|
|
20
23
|
INTENT_TOGGLE: str
|
21
24
|
INTENT_GET_STATE: str
|
22
25
|
INTENT_NEVERMIND: str
|
26
|
+
INTENT_SET_POSITION: str
|
23
27
|
SLOT_SCHEMA: Incomplete
|
24
28
|
DATA_KEY: str
|
25
29
|
SPEECH_TYPE_PLAIN: str
|
@@ -57,26 +61,36 @@ def async_test_feature(state: State, feature: int, feature_name: str) -> None: .
|
|
57
61
|
class IntentHandler:
|
58
62
|
intent_type: str | None
|
59
63
|
slot_schema: vol.Schema | None
|
60
|
-
_slot_schema: vol.Schema | None
|
61
64
|
platforms: Iterable[str] | None
|
62
65
|
def async_can_handle(self, intent_obj: Intent) -> bool: ...
|
63
66
|
def async_validate_slots(self, slots: _SlotsType) -> _SlotsType: ...
|
67
|
+
@cached_property
|
68
|
+
def _slot_schema(self) -> vol.Schema: ...
|
64
69
|
async def async_handle(self, intent_obj: Intent) -> IntentResponse: ...
|
65
70
|
def __repr__(self) -> str: ...
|
66
71
|
|
67
|
-
class
|
72
|
+
class DynamicServiceIntentHandler(IntentHandler, metaclass=abc.ABCMeta):
|
68
73
|
slot_schema: Incomplete
|
69
74
|
service_timeout: float
|
70
75
|
intent_type: Incomplete
|
71
|
-
domain: Incomplete
|
72
|
-
service: Incomplete
|
73
76
|
speech: Incomplete
|
74
|
-
|
77
|
+
extra_slots: Incomplete
|
78
|
+
def __init__(self, intent_type: str, speech: str | None = None, extra_slots: dict[str, vol.Schema] | None = None) -> None: ...
|
79
|
+
@cached_property
|
80
|
+
def _slot_schema(self) -> vol.Schema: ...
|
81
|
+
@abstractmethod
|
82
|
+
def get_domain_and_service(self, intent_obj: Intent, state: State) -> tuple[str, str]: ...
|
75
83
|
async def async_handle(self, intent_obj: Intent) -> IntentResponse: ...
|
76
84
|
async def async_handle_states(self, intent_obj: Intent, states: list[State], area: area_registry.AreaEntry | None = None) -> IntentResponse: ...
|
77
|
-
async def async_call_service(self, intent_obj: Intent, state: State) -> None: ...
|
85
|
+
async def async_call_service(self, domain: str, service: str, intent_obj: Intent, state: State) -> None: ...
|
78
86
|
async def _run_then_background(self, task: asyncio.Task[Any]) -> None: ...
|
79
87
|
|
88
|
+
class ServiceIntentHandler(DynamicServiceIntentHandler):
|
89
|
+
domain: Incomplete
|
90
|
+
service: Incomplete
|
91
|
+
def __init__(self, intent_type: str, domain: str, service: str, speech: str | None = None, extra_slots: dict[str, vol.Schema] | None = None) -> None: ...
|
92
|
+
def get_domain_and_service(self, intent_obj: Intent, state: State) -> tuple[str, str]: ...
|
93
|
+
|
80
94
|
class IntentCategory(Enum):
|
81
95
|
ACTION: str
|
82
96
|
QUERY: str
|
@@ -28,5 +28,6 @@ def json_dumps_sorted(data: Any) -> str: ...
|
|
28
28
|
JSON_DUMP: Final[Incomplete]
|
29
29
|
|
30
30
|
def _orjson_default_encoder(data: Any) -> str: ...
|
31
|
+
def _orjson_bytes_default_encoder(data: Any) -> bytes: ...
|
31
32
|
def save_json(filename: str, data: list | dict, private: bool = False, *, encoder: type[json.JSONEncoder] | None = None, atomic_writes: bool = False) -> None: ...
|
32
33
|
def find_paths_unserializable_data(bad_data: Any, *, dump: Callable[[Any], str] = ...) -> dict[str, Any]: ...
|
@@ -0,0 +1,59 @@
|
|
1
|
+
from .storage import Store as Store
|
2
|
+
from .typing import EventType as EventType, UNDEFINED as UNDEFINED, UndefinedType as UndefinedType
|
3
|
+
from _typeshed import Incomplete
|
4
|
+
from collections import UserDict
|
5
|
+
from collections.abc import Iterable, ValuesView
|
6
|
+
from dataclasses import dataclass
|
7
|
+
from homeassistant.core import HomeAssistant as HomeAssistant, callback as callback
|
8
|
+
from homeassistant.util import slugify as slugify
|
9
|
+
from typing import Literal, TypedDict
|
10
|
+
|
11
|
+
DATA_REGISTRY: str
|
12
|
+
EVENT_LABEL_REGISTRY_UPDATED: str
|
13
|
+
STORAGE_KEY: str
|
14
|
+
STORAGE_VERSION_MAJOR: int
|
15
|
+
SAVE_DELAY: int
|
16
|
+
|
17
|
+
class EventLabelRegistryUpdatedData(TypedDict):
|
18
|
+
action: Literal['create', 'remove', 'update']
|
19
|
+
label_id: str
|
20
|
+
EventLabelRegistryUpdated = EventType[EventLabelRegistryUpdatedData]
|
21
|
+
|
22
|
+
@dataclass(slots=True, frozen=True)
|
23
|
+
class LabelEntry:
|
24
|
+
label_id: str
|
25
|
+
name: str
|
26
|
+
normalized_name: str
|
27
|
+
description: str | None = ...
|
28
|
+
color: str | None = ...
|
29
|
+
icon: str | None = ...
|
30
|
+
def __init__(self, label_id, name, normalized_name, description, color, icon) -> None: ...
|
31
|
+
|
32
|
+
class LabelRegistryItems(UserDict[str, LabelEntry]):
|
33
|
+
_normalized_names: Incomplete
|
34
|
+
def __init__(self) -> None: ...
|
35
|
+
def values(self) -> ValuesView[LabelEntry]: ...
|
36
|
+
def __setitem__(self, key: str, entry: LabelEntry) -> None: ...
|
37
|
+
def __delitem__(self, key: str) -> None: ...
|
38
|
+
def get_label_by_name(self, name: str) -> LabelEntry | None: ...
|
39
|
+
|
40
|
+
class LabelRegistry:
|
41
|
+
labels: LabelRegistryItems
|
42
|
+
_label_data: dict[str, LabelEntry]
|
43
|
+
hass: Incomplete
|
44
|
+
_store: Incomplete
|
45
|
+
def __init__(self, hass: HomeAssistant) -> None: ...
|
46
|
+
def async_get_label(self, label_id: str) -> LabelEntry | None: ...
|
47
|
+
def async_get_label_by_name(self, name: str) -> LabelEntry | None: ...
|
48
|
+
def async_list_labels(self) -> Iterable[LabelEntry]: ...
|
49
|
+
def _generate_id(self, name: str) -> str: ...
|
50
|
+
def async_create(self, name: str, *, color: str | None = None, icon: str | None = None, description: str | None = None) -> LabelEntry: ...
|
51
|
+
def async_delete(self, label_id: str) -> None: ...
|
52
|
+
def async_update(self, label_id: str, *, color: str | None | UndefinedType = ..., description: str | None | UndefinedType = ..., icon: str | None | UndefinedType = ..., name: str | UndefinedType = ...) -> LabelEntry: ...
|
53
|
+
async def async_load(self) -> None: ...
|
54
|
+
def async_schedule_save(self) -> None: ...
|
55
|
+
def _data_to_save(self) -> dict[str, list[dict[str, str | None]]]: ...
|
56
|
+
|
57
|
+
def async_get(hass: HomeAssistant) -> LabelRegistry: ...
|
58
|
+
async def async_load(hass: HomeAssistant) -> None: ...
|
59
|
+
def _normalize_label_name(label_name: str) -> str: ...
|
@@ -0,0 +1,13 @@
|
|
1
|
+
from collections.abc import Callable as Callable, Iterable, Mapping
|
2
|
+
from homeassistant.core import callback as callback
|
3
|
+
from typing import Any, TypeVar, overload
|
4
|
+
|
5
|
+
REDACTED: str
|
6
|
+
_T = TypeVar('_T')
|
7
|
+
_ValueT = TypeVar('_ValueT')
|
8
|
+
|
9
|
+
def partial_redact(x: str | Any, unmasked_prefix: int = 4, unmasked_suffix: int = 4) -> str: ...
|
10
|
+
@overload
|
11
|
+
def async_redact_data(data: Mapping, to_redact: Iterable[Any] | Mapping[Any, Callable[[_ValueT], _ValueT]]) -> dict: ...
|
12
|
+
@overload
|
13
|
+
def async_redact_data(data: _T, to_redact: Iterable[Any] | Mapping[Any, Callable[[_ValueT], _ValueT]]) -> _T: ...
|
@@ -12,6 +12,7 @@ from homeassistant.const import ATTR_AREA_ID as ATTR_AREA_ID, ATTR_DEVICE_ID as
|
|
12
12
|
from homeassistant.core import Context as Context, EntityServiceResponse as EntityServiceResponse, HassJob as HassJob, HomeAssistant as HomeAssistant, ServiceCall as ServiceCall, ServiceResponse as ServiceResponse, SupportsResponse as SupportsResponse, callback as callback
|
13
13
|
from homeassistant.exceptions import HomeAssistantError as HomeAssistantError, TemplateError as TemplateError, Unauthorized as Unauthorized, UnknownUser as UnknownUser
|
14
14
|
from homeassistant.loader import Integration as Integration, async_get_integrations as async_get_integrations, bind_hass as bind_hass
|
15
|
+
from homeassistant.util.async_ import create_eager_task as create_eager_task
|
15
16
|
from homeassistant.util.yaml import load_yaml_dict as load_yaml_dict
|
16
17
|
from homeassistant.util.yaml.loader import JSON_TYPE as JSON_TYPE
|
17
18
|
from types import ModuleType
|
@@ -1,5 +1,6 @@
|
|
1
1
|
from _typeshed import Incomplete
|
2
2
|
from collections.abc import Callable as Callable, Mapping, Sequence
|
3
|
+
from functools import cached_property as cached_property
|
3
4
|
from homeassistant.const import EVENT_HOMEASSISTANT_FINAL_WRITE as EVENT_HOMEASSISTANT_FINAL_WRITE
|
4
5
|
from homeassistant.core import CALLBACK_TYPE as CALLBACK_TYPE, CoreState as CoreState, Event as Event, HomeAssistant as HomeAssistant, callback as callback
|
5
6
|
from homeassistant.exceptions import HomeAssistantError as HomeAssistantError
|
@@ -22,25 +23,28 @@ class Store(Generic[_T]):
|
|
22
23
|
hass: Incomplete
|
23
24
|
_private: Incomplete
|
24
25
|
_data: Incomplete
|
25
|
-
|
26
|
+
_delay_handle: Incomplete
|
26
27
|
_unsub_final_write_listener: Incomplete
|
27
28
|
_write_lock: Incomplete
|
28
29
|
_load_task: Incomplete
|
29
30
|
_encoder: Incomplete
|
30
31
|
_atomic_writes: Incomplete
|
31
32
|
_read_only: Incomplete
|
33
|
+
_next_write_time: float
|
32
34
|
def __init__(self, hass: HomeAssistant, version: int, key: str, private: bool = False, *, atomic_writes: bool = False, encoder: type[JSONEncoder] | None = None, minor_version: int = 1, read_only: bool = False) -> None: ...
|
33
|
-
@
|
35
|
+
@cached_property
|
34
36
|
def path(self): ...
|
35
37
|
async def async_load(self) -> _T | None: ...
|
36
38
|
async def _async_load(self) -> _T | None: ...
|
37
39
|
async def _async_load_data(self): ...
|
38
40
|
async def async_save(self, data: _T) -> None: ...
|
39
41
|
def async_delay_save(self, data_func: Callable[[], _T], delay: float = 0) -> None: ...
|
42
|
+
def _async_reschedule_delayed_write(self, when: float) -> None: ...
|
43
|
+
def _async_schedule_callback_delayed_write(self) -> None: ...
|
40
44
|
def _async_ensure_final_write_listener(self) -> None: ...
|
41
45
|
def _async_cleanup_final_write_listener(self) -> None: ...
|
42
46
|
def _async_cleanup_delay_listener(self) -> None: ...
|
43
|
-
async def _async_callback_delayed_write(self
|
47
|
+
async def _async_callback_delayed_write(self) -> None: ...
|
44
48
|
async def _async_callback_final_write(self, _event: Event) -> None: ...
|
45
49
|
async def _async_handle_write_data(self, *_args) -> None: ...
|
46
50
|
async def _async_write_data(self, path: str, data: dict) -> None: ...
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import jinja2
|
2
2
|
from . import area_registry as area_registry, device_registry as device_registry, entity_registry as entity_registry
|
3
3
|
from .singleton import singleton as singleton
|
4
|
+
from .translation import async_translate_state as async_translate_state
|
4
5
|
from .typing import TemplateVarsType as TemplateVarsType
|
5
6
|
from _typeshed import Incomplete
|
6
7
|
from collections.abc import Callable as Callable, Generator, Iterable
|
@@ -148,6 +149,12 @@ class AllStates:
|
|
148
149
|
def __call__(self, entity_id: str, rounded: bool | object = ..., with_unit: bool = False) -> str: ...
|
149
150
|
def __repr__(self) -> str: ...
|
150
151
|
|
152
|
+
class StateTranslated:
|
153
|
+
_hass: Incomplete
|
154
|
+
def __init__(self, hass: HomeAssistant) -> None: ...
|
155
|
+
def __call__(self, entity_id: str) -> str | None: ...
|
156
|
+
def __repr__(self) -> str: ...
|
157
|
+
|
151
158
|
class DomainStates:
|
152
159
|
__slots__: Incomplete
|
153
160
|
__setitem__ = _readonly
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from _typeshed import Incomplete
|
2
2
|
from collections.abc import Iterable
|
3
|
-
from homeassistant.
|
3
|
+
from homeassistant.const import EVENT_CORE_CONFIG_UPDATE as EVENT_CORE_CONFIG_UPDATE, STATE_UNAVAILABLE as STATE_UNAVAILABLE, STATE_UNKNOWN as STATE_UNKNOWN
|
4
|
+
from homeassistant.core import Event as Event, HomeAssistant as HomeAssistant, callback as callback
|
4
5
|
from homeassistant.loader import Integration as Integration, async_get_config_flows as async_get_config_flows, async_get_integrations as async_get_integrations, bind_hass as bind_hass
|
5
6
|
from homeassistant.util.json import load_json as load_json
|
6
7
|
from typing import Any
|
@@ -11,10 +12,10 @@ LOCALE_EN: str
|
|
11
12
|
|
12
13
|
def recursive_flatten(prefix: Any, data: dict[str, Any]) -> dict[str, Any]: ...
|
13
14
|
def component_translation_path(component: str, language: str, integration: Integration) -> str | None: ...
|
14
|
-
def
|
15
|
+
def _load_translations_files_by_language(translation_files: dict[str, dict[str, str]]) -> dict[str, dict[str, Any]]: ...
|
15
16
|
def _merge_resources(translation_strings: dict[str, dict[str, Any]], components: set[str], category: str) -> dict[str, dict[str, Any]]: ...
|
16
|
-
def build_resources(translation_strings: dict[str, dict[str, Any]], components: set[str], category: str) -> dict[str, dict[str, Any] | str]: ...
|
17
|
-
async def _async_get_component_strings(hass: HomeAssistant,
|
17
|
+
def build_resources(translation_strings: dict[str, dict[str, dict[str, Any] | str]], components: set[str], category: str) -> dict[str, dict[str, Any] | str]: ...
|
18
|
+
async def _async_get_component_strings(hass: HomeAssistant, languages: Iterable[str], components: set[str], integrations: dict[str, Integration]) -> dict[str, dict[str, Any]]: ...
|
18
19
|
|
19
20
|
class _TranslationCache:
|
20
21
|
__slots__: Incomplete
|
@@ -23,9 +24,22 @@ class _TranslationCache:
|
|
23
24
|
cache: Incomplete
|
24
25
|
lock: Incomplete
|
25
26
|
def __init__(self, hass: HomeAssistant) -> None: ...
|
27
|
+
def async_is_loaded(self, language: str, components: set[str]) -> bool: ...
|
28
|
+
async def async_load(self, language: str, components: set[str]) -> None: ...
|
26
29
|
async def async_fetch(self, language: str, category: str, components: set[str]) -> dict[str, str]: ...
|
30
|
+
def get_cached(self, language: str, category: str, components: set[str]) -> dict[str, str]: ...
|
27
31
|
async def _async_load(self, language: str, components: set[str]) -> None: ...
|
28
32
|
def _validate_placeholders(self, language: str, updated_resources: dict[str, Any], cached_resources: dict[str, Any] | None = None) -> dict[str, Any]: ...
|
29
33
|
def _build_category_cache(self, language: str, components: set[str], translation_strings: dict[str, dict[str, Any]]) -> None: ...
|
30
34
|
|
31
35
|
async def async_get_translations(hass: HomeAssistant, language: str, category: str, integrations: Iterable[str] | None = None, config_flow: bool | None = None) -> dict[str, str]: ...
|
36
|
+
def async_get_cached_translations(hass: HomeAssistant, language: str, category: str, integration: str | None = None) -> dict[str, str]: ...
|
37
|
+
def _async_get_translations_cache(hass: HomeAssistant) -> _TranslationCache: ...
|
38
|
+
|
39
|
+
_DIRECT_MAPPED_CATEGORIES: Incomplete
|
40
|
+
|
41
|
+
def _async_get_components(hass: HomeAssistant, category: str) -> set[str]: ...
|
42
|
+
def async_setup(hass: HomeAssistant) -> None: ...
|
43
|
+
async def async_load_integrations(hass: HomeAssistant, integrations: set[str]) -> None: ...
|
44
|
+
def async_translations_loaded(hass: HomeAssistant, components: set[str]) -> bool: ...
|
45
|
+
def async_translate_state(hass: HomeAssistant, state: str, domain: str, platform: str | None, translation_key: str | None, device_class: str | None) -> str: ...
|
@@ -58,6 +58,7 @@ class DataUpdateCoordinator(BaseDataUpdateCoordinatorProtocol, Generic[_DataT]):
|
|
58
58
|
@update_interval.setter
|
59
59
|
def update_interval(self, value: timedelta | None) -> None: ...
|
60
60
|
def _schedule_refresh(self) -> None: ...
|
61
|
+
def __wrap_handle_refresh_interval(self) -> None: ...
|
61
62
|
async def _handle_refresh_interval(self, _now: datetime | None = None) -> None: ...
|
62
63
|
async def async_request_refresh(self) -> None: ...
|
63
64
|
async def _async_update_data(self) -> _DataT: ...
|
homeassistant-stubs/loader.pyi
CHANGED
@@ -5,6 +5,7 @@ from .config_entries import ConfigEntry as ConfigEntry
|
|
5
5
|
from .core import HomeAssistant as HomeAssistant, callback as callback
|
6
6
|
from .generated.application_credentials import APPLICATION_CREDENTIALS as APPLICATION_CREDENTIALS
|
7
7
|
from .generated.bluetooth import BLUETOOTH as BLUETOOTH
|
8
|
+
from .generated.config_flows import FLOWS as FLOWS
|
8
9
|
from .generated.dhcp import DHCP as DHCP
|
9
10
|
from .generated.mqtt import MQTT as MQTT
|
10
11
|
from .generated.ssdp import SSDP as SSDP
|
@@ -23,8 +24,17 @@ from typing import Any, Literal, Protocol, TypeVar, TypedDict
|
|
23
24
|
|
24
25
|
_CallableT = TypeVar('_CallableT', bound=Callable[..., Any])
|
25
26
|
_LOGGER: Incomplete
|
27
|
+
|
28
|
+
@dataclass
|
29
|
+
class BlockedIntegration:
|
30
|
+
lowest_good_version: AwesomeVersion | None
|
31
|
+
reason: str
|
32
|
+
def __init__(self, lowest_good_version, reason) -> None: ...
|
33
|
+
|
34
|
+
BLOCKED_CUSTOM_INTEGRATIONS: dict[str, BlockedIntegration]
|
26
35
|
DATA_COMPONENTS: str
|
27
36
|
DATA_INTEGRATIONS: str
|
37
|
+
DATA_MISSING_PLATFORMS: str
|
28
38
|
DATA_CUSTOM_COMPONENTS: str
|
29
39
|
PACKAGE_CUSTOM_COMPONENTS: str
|
30
40
|
PACKAGE_BUILTIN: str
|
@@ -103,6 +113,8 @@ class Manifest(TypedDict, total=False):
|
|
103
113
|
version: str
|
104
114
|
codeowners: list[str]
|
105
115
|
loggers: list[str]
|
116
|
+
import_executor: bool
|
117
|
+
single_config_entry: bool
|
106
118
|
|
107
119
|
def async_setup(hass: HomeAssistant) -> None: ...
|
108
120
|
def manifest_from_legacy_module(domain: str, module: ModuleType) -> Manifest: ...
|
@@ -143,33 +155,36 @@ class Integration:
|
|
143
155
|
manifest: Incomplete
|
144
156
|
_all_dependencies_resolved: Incomplete
|
145
157
|
_all_dependencies: Incomplete
|
158
|
+
_import_futures: Incomplete
|
146
159
|
def __init__(self, hass: HomeAssistant, pkg_path: str, file_path: pathlib.Path, manifest: Manifest) -> None: ...
|
147
160
|
@cached_property
|
148
161
|
def name(self) -> str: ...
|
149
162
|
@cached_property
|
150
163
|
def disabled(self) -> str | None: ...
|
151
|
-
@
|
164
|
+
@cached_property
|
152
165
|
def domain(self) -> str: ...
|
153
|
-
@
|
166
|
+
@cached_property
|
154
167
|
def dependencies(self) -> list[str]: ...
|
155
|
-
@
|
168
|
+
@cached_property
|
156
169
|
def after_dependencies(self) -> list[str]: ...
|
157
|
-
@
|
170
|
+
@cached_property
|
158
171
|
def requirements(self) -> list[str]: ...
|
159
|
-
@
|
172
|
+
@cached_property
|
160
173
|
def config_flow(self) -> bool: ...
|
161
|
-
@
|
174
|
+
@cached_property
|
162
175
|
def documentation(self) -> str | None: ...
|
163
|
-
@
|
176
|
+
@cached_property
|
164
177
|
def issue_tracker(self) -> str | None: ...
|
165
|
-
@
|
178
|
+
@cached_property
|
166
179
|
def loggers(self) -> list[str] | None: ...
|
167
|
-
@
|
180
|
+
@cached_property
|
168
181
|
def quality_scale(self) -> str | None: ...
|
169
|
-
@
|
182
|
+
@cached_property
|
170
183
|
def iot_class(self) -> str | None: ...
|
171
184
|
@cached_property
|
172
185
|
def integration_type(self) -> Literal['entity', 'device', 'hardware', 'helper', 'hub', 'service', 'system']: ...
|
186
|
+
@cached_property
|
187
|
+
def import_executor(self) -> bool: ...
|
173
188
|
@property
|
174
189
|
def mqtt(self) -> list[str] | None: ...
|
175
190
|
@property
|
@@ -188,17 +203,24 @@ class Integration:
|
|
188
203
|
def is_built_in(self) -> bool: ...
|
189
204
|
@property
|
190
205
|
def version(self) -> AwesomeVersion | None: ...
|
206
|
+
@cached_property
|
207
|
+
def single_config_entry(self) -> bool: ...
|
191
208
|
@property
|
192
209
|
def all_dependencies(self) -> set[str]: ...
|
193
210
|
@property
|
194
211
|
def all_dependencies_resolved(self) -> bool: ...
|
195
212
|
async def resolve_dependencies(self) -> bool: ...
|
213
|
+
async def async_get_component(self) -> ComponentProtocol: ...
|
196
214
|
def get_component(self) -> ComponentProtocol: ...
|
215
|
+
async def async_get_platform(self, platform_name: str) -> ModuleType: ...
|
216
|
+
def _get_platform_cached(self, full_name: str) -> ModuleType | None: ...
|
197
217
|
def get_platform(self, platform_name: str) -> ModuleType: ...
|
218
|
+
def _load_platform(self, platform_name: str) -> ModuleType: ...
|
198
219
|
def _import_platform(self, platform_name: str) -> ModuleType: ...
|
199
220
|
def __repr__(self) -> str: ...
|
200
221
|
|
201
|
-
def
|
222
|
+
def _version_blocked(integration_version: AwesomeVersion, blocked_integration: BlockedIntegration) -> bool: ...
|
223
|
+
def _resolve_integrations_from_root(hass: HomeAssistant, root_module: ModuleType, domains: Iterable[str]) -> dict[str, Integration]: ...
|
202
224
|
def async_get_loaded_integration(hass: HomeAssistant, domain: str) -> Integration: ...
|
203
225
|
async def async_get_integration(hass: HomeAssistant, domain: str) -> Integration: ...
|
204
226
|
async def async_get_integrations(hass: HomeAssistant, domains: Iterable[str]) -> dict[str, Integration | Exception]: ...
|
@@ -241,5 +263,5 @@ async def _async_component_dependencies(hass: HomeAssistant, integration: Integr
|
|
241
263
|
def _async_mount_config_dir(hass: HomeAssistant) -> None: ...
|
242
264
|
def _lookup_path(hass: HomeAssistant) -> list[str]: ...
|
243
265
|
def is_component_module_loaded(hass: HomeAssistant, module: str) -> bool: ...
|
244
|
-
def async_get_issue_tracker(hass: HomeAssistant | None, *, integration_domain: str | None = None, module: str | None = None) -> str | None: ...
|
245
|
-
def async_suggest_report_issue(hass: HomeAssistant | None, *, integration_domain: str | None = None, module: str | None = None) -> str: ...
|
266
|
+
def async_get_issue_tracker(hass: HomeAssistant | None, *, integration: Integration | None = None, integration_domain: str | None = None, module: str | None = None) -> str | None: ...
|
267
|
+
def async_suggest_report_issue(hass: HomeAssistant | None, *, integration: Integration | None = None, integration_domain: str | None = None, module: str | None = None) -> str: ...
|