homeassistant-stubs 2023.3.6__py3-none-any.whl → 2023.4.0b1__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/auth/__init__.pyi +1 -1
- homeassistant-stubs/auth/jwt_wrapper.pyi +14 -0
- homeassistant-stubs/auth/permissions/models.pyi +3 -3
- homeassistant-stubs/bootstrap.pyi +1 -1
- homeassistant-stubs/components/aladdin_connect/config_flow.pyi +0 -2
- homeassistant-stubs/components/aladdin_connect/cover.pyi +5 -7
- homeassistant-stubs/components/alarm_control_panel/device_action.pyi +0 -1
- homeassistant-stubs/components/alarm_control_panel/device_condition.pyi +1 -1
- homeassistant-stubs/components/alarm_control_panel/device_trigger.pyi +0 -1
- homeassistant-stubs/components/amazon_polly/tts.pyi +2 -2
- homeassistant-stubs/components/amcrest/camera.pyi +0 -1
- homeassistant-stubs/components/awair/sensor.pyi +2 -1
- homeassistant-stubs/components/backup/manager.pyi +2 -1
- homeassistant-stubs/components/bayesian/issues.pyi +0 -1
- homeassistant-stubs/components/bluetooth/wrappers.pyi +1 -0
- homeassistant-stubs/components/bmw_connected_drive/config_flow.pyi +3 -0
- homeassistant-stubs/components/bmw_connected_drive/coordinator.pyi +1 -0
- homeassistant-stubs/components/braviatv/media_player.pyi +2 -2
- homeassistant-stubs/components/button/device_action.pyi +0 -1
- homeassistant-stubs/components/button/device_trigger.pyi +0 -1
- homeassistant-stubs/components/calendar/__init__.pyi +8 -4
- homeassistant-stubs/components/calendar/const.pyi +2 -2
- homeassistant-stubs/components/calendar/trigger.pyi +25 -8
- homeassistant-stubs/components/camera/__init__.pyi +1 -1
- homeassistant-stubs/components/cover/device_action.pyi +0 -1
- homeassistant-stubs/components/cover/device_condition.pyi +1 -1
- homeassistant-stubs/components/cover/device_trigger.pyi +0 -1
- homeassistant-stubs/components/demo/sensor.pyi +2 -1
- homeassistant-stubs/components/demo/stt.pyi +2 -2
- homeassistant-stubs/components/device_automation/condition.pyi +2 -4
- homeassistant-stubs/components/device_tracker/device_condition.pyi +1 -1
- homeassistant-stubs/components/device_tracker/device_trigger.pyi +0 -1
- homeassistant-stubs/components/devolo_home_network/device_tracker.pyi +0 -1
- homeassistant-stubs/components/devolo_home_network/entity.pyi +1 -0
- homeassistant-stubs/components/dlna_dmr/config_flow.pyi +0 -1
- homeassistant-stubs/components/dlna_dmr/media_player.pyi +1 -2
- homeassistant-stubs/components/dormakaba_dkey/__init__.pyi +1 -1
- homeassistant-stubs/components/dormakaba_dkey/config_flow.pyi +5 -1
- homeassistant-stubs/components/efergy/sensor.pyi +2 -2
- homeassistant-stubs/components/emulated_hue/hue_api.pyi +1 -0
- homeassistant-stubs/components/energy/types.pyi +2 -2
- homeassistant-stubs/components/energy/websocket_api.pyi +1 -0
- homeassistant-stubs/components/esphome/bluetooth/client.pyi +3 -1
- homeassistant-stubs/components/esphome/entry_data.pyi +1 -0
- homeassistant-stubs/components/esphome/media_player.pyi +1 -1
- homeassistant-stubs/components/fan/device_condition.pyi +1 -1
- homeassistant-stubs/components/filesize/__init__.pyi +1 -2
- homeassistant-stubs/components/fitbit/sensor.pyi +1 -1
- homeassistant-stubs/components/fritz/binary_sensor.pyi +7 -11
- homeassistant-stubs/components/fritz/common.pyi +25 -3
- homeassistant-stubs/components/fritz/sensor.pyi +6 -15
- homeassistant-stubs/components/fritzbox/sensor.pyi +0 -1
- homeassistant-stubs/components/fronius/coordinator.pyi +2 -3
- homeassistant-stubs/components/fronius/sensor.pyi +13 -8
- homeassistant-stubs/components/fully_kiosk/media_player.pyi +3 -3
- homeassistant-stubs/components/fully_kiosk/sensor.pyi +3 -3
- homeassistant-stubs/components/gios/__init__.pyi +3 -3
- homeassistant-stubs/components/gios/const.pyi +0 -2
- homeassistant-stubs/components/gios/sensor.pyi +10 -13
- homeassistant-stubs/components/google/__init__.pyi +1 -1
- homeassistant-stubs/components/google/calendar.pyi +1 -1
- homeassistant-stubs/components/google/const.pyi +1 -0
- homeassistant-stubs/components/group/media_player.pyi +4 -3
- homeassistant-stubs/components/group/notify.pyi +1 -1
- homeassistant-stubs/components/group/sensor.pyi +2 -0
- homeassistant-stubs/components/guardian/util.pyi +0 -1
- homeassistant-stubs/components/history/websocket_api.pyi +2 -1
- homeassistant-stubs/components/homeassistant_alerts/__init__.pyi +4 -2
- homeassistant-stubs/components/homeassistant_hardware/silabs_multiprotocol_addon.pyi +7 -2
- homeassistant-stubs/components/homeassistant_sky_connect/__init__.pyi +2 -8
- homeassistant-stubs/components/homeassistant_yellow/__init__.pyi +3 -7
- homeassistant-stubs/components/homekit/__init__.pyi +6 -6
- homeassistant-stubs/components/homekit/config_flow.pyi +2 -2
- homeassistant-stubs/components/homekit/type_triggers.pyi +0 -1
- homeassistant-stubs/components/http/__init__.pyi +18 -1
- homeassistant-stubs/components/http/auth.pyi +1 -0
- homeassistant-stubs/components/http/security_filter.pyi +1 -0
- homeassistant-stubs/components/huawei_lte/__init__.pyi +1 -1
- homeassistant-stubs/components/huawei_lte/device_tracker.pyi +0 -1
- homeassistant-stubs/components/isy994/lock.pyi +8 -3
- homeassistant-stubs/components/isy994/services.pyi +6 -0
- homeassistant-stubs/components/jellyfin/coordinator.pyi +4 -2
- homeassistant-stubs/components/jellyfin/media_player.pyi +3 -3
- homeassistant-stubs/components/knx/__init__.pyi +3 -2
- homeassistant-stubs/components/knx/device.pyi +18 -0
- homeassistant-stubs/components/knx/light.pyi +2 -2
- homeassistant-stubs/components/knx/sensor.pyi +33 -2
- homeassistant-stubs/components/kraken/sensor.pyi +0 -1
- homeassistant-stubs/components/lametric/__init__.pyi +1 -2
- homeassistant-stubs/components/lidarr/const.pyi +0 -2
- homeassistant-stubs/components/lifx/__init__.pyi +2 -2
- homeassistant-stubs/components/light/intent.pyi +1 -1
- homeassistant-stubs/components/litejet/__init__.pyi +14 -0
- homeassistant-stubs/components/litejet/config_flow.pyi +18 -0
- homeassistant-stubs/components/litejet/const.pyi +8 -0
- homeassistant-stubs/components/litejet/diagnostics.pyi +7 -0
- homeassistant-stubs/components/litejet/light.pyi +39 -0
- homeassistant-stubs/components/litejet/scene.pyi +32 -0
- homeassistant-stubs/components/litejet/switch.pyi +37 -0
- homeassistant-stubs/components/litejet/trigger.pyi +16 -0
- homeassistant-stubs/components/litterrobot/select.pyi +11 -6
- homeassistant-stubs/components/lock/device_action.pyi +0 -1
- homeassistant-stubs/components/lock/device_condition.pyi +1 -1
- homeassistant-stubs/components/lock/device_trigger.pyi +0 -1
- homeassistant-stubs/components/logbook/__init__.pyi +3 -3
- homeassistant-stubs/components/logbook/const.pyi +0 -2
- homeassistant-stubs/components/logbook/helpers.pyi +1 -1
- homeassistant-stubs/components/logbook/models.pyi +25 -7
- homeassistant-stubs/components/logbook/processor.pyi +8 -7
- homeassistant-stubs/components/logbook/queries/__init__.pyi +3 -1
- homeassistant-stubs/components/logbook/queries/all.pyi +4 -4
- homeassistant-stubs/components/logbook/queries/common.pyi +2 -2
- homeassistant-stubs/components/logbook/queries/devices.pyi +1 -1
- homeassistant-stubs/components/logbook/queries/entities.pyi +6 -6
- homeassistant-stubs/components/logbook/queries/entities_and_devices.pyi +5 -5
- homeassistant-stubs/components/logbook/websocket_api.pyi +2 -2
- homeassistant-stubs/components/logger/helpers.pyi +1 -1
- homeassistant-stubs/components/logger/websocket_api.pyi +1 -1
- homeassistant-stubs/components/matter/binary_sensor.pyi +5 -1
- homeassistant-stubs/components/matter/entity.pyi +5 -1
- homeassistant-stubs/components/matter/lock.pyi +44 -0
- homeassistant-stubs/components/matter/models.pyi +2 -9
- homeassistant-stubs/components/matter/sensor.pyi +5 -1
- homeassistant-stubs/components/media_player/__init__.pyi +2 -2
- homeassistant-stubs/components/media_player/device_condition.pyi +1 -1
- homeassistant-stubs/components/media_player/device_trigger.pyi +0 -1
- homeassistant-stubs/components/metoffice/__init__.pyi +0 -2
- homeassistant-stubs/components/metoffice/sensor.pyi +2 -1
- homeassistant-stubs/components/mikrotik/const.pyi +2 -0
- homeassistant-stubs/components/mikrotik/device_tracker.pyi +0 -1
- homeassistant-stubs/components/mikrotik/hub.pyi +2 -1
- homeassistant-stubs/components/modbus/__init__.pyi +1 -1
- homeassistant-stubs/components/modbus/climate.pyi +3 -1
- homeassistant-stubs/components/modbus/const.pyi +1 -0
- homeassistant-stubs/components/modbus/modbus.pyi +1 -1
- homeassistant-stubs/components/modem_callerid/button.pyi +2 -2
- homeassistant-stubs/components/modem_callerid/sensor.pyi +2 -2
- homeassistant-stubs/components/moon/config_flow.pyi +0 -2
- homeassistant-stubs/components/moon/sensor.pyi +2 -7
- homeassistant-stubs/components/mqtt/__init__.pyi +5 -7
- homeassistant-stubs/components/mqtt/client.pyi +24 -2
- homeassistant-stubs/components/mqtt/config_integration.pyi +1 -1
- homeassistant-stubs/components/mqtt/const.pyi +0 -1
- homeassistant-stubs/components/mqtt/models.pyi +2 -1
- homeassistant-stubs/components/mysensors/__init__.pyi +4 -9
- homeassistant-stubs/components/mysensors/const.pyi +1 -3
- homeassistant-stubs/components/mysensors/device.pyi +1 -1
- homeassistant-stubs/components/mysensors/light.pyi +1 -1
- homeassistant-stubs/components/mysensors/switch.pyi +6 -20
- homeassistant-stubs/components/nam/__init__.pyi +0 -2
- homeassistant-stubs/components/nam/sensor.pyi +0 -1
- homeassistant-stubs/components/netatmo/device_trigger.pyi +0 -1
- homeassistant-stubs/components/nissan_leaf/sensor.pyi +2 -3
- homeassistant-stubs/components/notify/legacy.pyi +2 -2
- homeassistant-stubs/components/number/const.pyi +2 -0
- homeassistant-stubs/components/number/device_action.pyi +0 -1
- homeassistant-stubs/components/otbr/__init__.pyi +3 -0
- homeassistant-stubs/components/otbr/config_flow.pyi +3 -2
- homeassistant-stubs/components/otbr/util.pyi +6 -0
- homeassistant-stubs/components/otbr/websocket_api.pyi +7 -3
- homeassistant-stubs/components/overkiz/climate_entities/__init__.pyi +1 -0
- homeassistant-stubs/components/overkiz/climate_entities/atlantic_electrical_heater.pyi +2 -0
- homeassistant-stubs/components/overkiz/climate_entities/atlantic_electrical_heater_with_adjustable_temperature_setpoint.pyi +2 -0
- homeassistant-stubs/components/overkiz/climate_entities/atlantic_electrical_towel_dryer.pyi +2 -0
- homeassistant-stubs/components/overkiz/climate_entities/atlantic_heat_recovery_ventilation.pyi +2 -0
- homeassistant-stubs/components/overkiz/climate_entities/atlantic_pass_apc_heating_zone.pyi +2 -0
- homeassistant-stubs/components/overkiz/climate_entities/somfy_thermostat.pyi +2 -2
- homeassistant-stubs/components/overkiz/climate_entities/valve_heating_temperature_interface.pyi +37 -0
- homeassistant-stubs/components/overkiz/const.pyi +2 -1
- homeassistant-stubs/components/overkiz/sensor.pyi +3 -1
- homeassistant-stubs/components/overkiz/switch.pyi +2 -2
- homeassistant-stubs/components/pi_hole/sensor.pyi +2 -2
- homeassistant-stubs/components/rainmachine/util.pyi +0 -1
- homeassistant-stubs/components/recorder/__init__.pyi +3 -3
- homeassistant-stubs/components/recorder/auto_repairs/__init__.pyi +0 -0
- homeassistant-stubs/components/recorder/auto_repairs/events/__init__.pyi +0 -0
- homeassistant-stubs/components/recorder/auto_repairs/events/schema.pyi +6 -0
- homeassistant-stubs/components/recorder/auto_repairs/schema.pyi +23 -0
- homeassistant-stubs/components/recorder/auto_repairs/states/schema.pyi +9 -0
- homeassistant-stubs/components/recorder/auto_repairs/statistics/__init__.pyi +0 -0
- homeassistant-stubs/components/recorder/auto_repairs/statistics/duplicates.pyi +19 -0
- homeassistant-stubs/components/recorder/auto_repairs/statistics/schema.pyi +9 -0
- homeassistant-stubs/components/recorder/const.pyi +10 -0
- homeassistant-stubs/components/recorder/core.pyi +33 -29
- homeassistant-stubs/components/recorder/db_schema.pyi +36 -6
- homeassistant-stubs/components/recorder/entity_registry.pyi +10 -0
- homeassistant-stubs/components/recorder/filters.pyi +13 -11
- homeassistant-stubs/components/recorder/history/__init__.pyi +13 -0
- homeassistant-stubs/components/recorder/history/common.pyi +4 -0
- homeassistant-stubs/components/recorder/history/const.pyi +9 -0
- homeassistant-stubs/components/recorder/{history.pyi → history/legacy.pyi} +9 -14
- homeassistant-stubs/components/recorder/history/modern.pyi +41 -0
- homeassistant-stubs/components/recorder/migration.pyi +34 -6
- homeassistant-stubs/components/recorder/models/__init__.pyi +5 -0
- homeassistant-stubs/components/recorder/models/context.pyi +6 -0
- homeassistant-stubs/components/recorder/models/database.pyi +14 -0
- homeassistant-stubs/components/recorder/models/legacy.pyi +39 -0
- homeassistant-stubs/components/recorder/models/state.pyi +43 -0
- homeassistant-stubs/components/recorder/models/state_attributes.pyi +9 -0
- homeassistant-stubs/components/recorder/models/statistics.pyi +50 -0
- homeassistant-stubs/components/recorder/models/time.pyi +20 -0
- homeassistant-stubs/components/recorder/purge.pyi +9 -12
- homeassistant-stubs/components/recorder/queries.pyi +19 -3
- homeassistant-stubs/components/recorder/services.pyi +1 -1
- homeassistant-stubs/components/recorder/statistics.pyi +40 -42
- homeassistant-stubs/components/recorder/table_managers/__init__.pyi +20 -0
- homeassistant-stubs/components/recorder/table_managers/event_data.pyi +26 -0
- homeassistant-stubs/components/recorder/table_managers/event_types.pyi +20 -0
- homeassistant-stubs/components/recorder/{run_history.pyi → table_managers/recorder_runs.pyi} +3 -3
- homeassistant-stubs/components/recorder/table_managers/state_attributes.pyi +29 -0
- homeassistant-stubs/components/recorder/table_managers/states.pyi +14 -0
- homeassistant-stubs/components/recorder/table_managers/states_meta.pyi +23 -0
- homeassistant-stubs/components/recorder/table_managers/statistics_meta.pyi +35 -0
- homeassistant-stubs/components/recorder/tasks.pyi +39 -4
- homeassistant-stubs/components/recorder/util.pyi +2 -1
- homeassistant-stubs/components/recorder/websocket_api.pyi +2 -2
- homeassistant-stubs/components/renault/renault_vehicle.pyi +1 -0
- homeassistant-stubs/components/rest/__init__.pyi +1 -1
- homeassistant-stubs/components/rest/const.pyi +2 -0
- homeassistant-stubs/components/rest/data.pyi +3 -2
- homeassistant-stubs/components/rest/schema.pyi +1 -1
- homeassistant-stubs/components/ridwell/calendar.pyi +22 -0
- homeassistant-stubs/components/ridwell/coordinator.pyi +2 -2
- homeassistant-stubs/components/ridwell/entity.pyi +2 -4
- homeassistant-stubs/components/ridwell/sensor.pyi +2 -1
- homeassistant-stubs/components/ridwell/switch.pyi +4 -0
- homeassistant-stubs/components/roku/media_player.pyi +4 -4
- homeassistant-stubs/components/samsungtv/device_trigger.pyi +19 -0
- homeassistant-stubs/components/samsungtv/helpers.pyi +8 -0
- homeassistant-stubs/components/samsungtv/media_player.pyi +7 -2
- homeassistant-stubs/components/samsungtv/trigger.pyi +12 -0
- homeassistant-stubs/components/samsungtv/triggers/__init__.pyi +0 -0
- homeassistant-stubs/components/samsungtv/triggers/turn_on.pyi +14 -0
- homeassistant-stubs/components/scrape/config_flow.pyi +1 -1
- homeassistant-stubs/components/scrape/const.pyi +2 -0
- homeassistant-stubs/components/scrape/sensor.pyi +3 -6
- homeassistant-stubs/components/select/device_action.pyi +0 -1
- homeassistant-stubs/components/select/device_condition.pyi +1 -1
- homeassistant-stubs/components/select/device_trigger.pyi +0 -1
- homeassistant-stubs/components/sensor/const.pyi +2 -0
- homeassistant-stubs/components/sensor/recorder.pyi +3 -1
- homeassistant-stubs/components/sfr_box/__init__.pyi +1 -1
- homeassistant-stubs/components/sfr_box/binary_sensor.pyi +3 -1
- homeassistant-stubs/components/sfr_box/models.pyi +4 -2
- homeassistant-stubs/components/sfr_box/sensor.pyi +2 -1
- homeassistant-stubs/components/sleepiq/entity.pyi +0 -1
- homeassistant-stubs/components/statistics/sensor.pyi +2 -2
- homeassistant-stubs/components/sun/__init__.pyi +1 -1
- homeassistant-stubs/components/sun/sensor.pyi +36 -0
- homeassistant-stubs/components/switcher_kis/__init__.pyi +1 -1
- homeassistant-stubs/components/switcher_kis/button.pyi +0 -1
- homeassistant-stubs/components/switcher_kis/climate.pyi +0 -1
- homeassistant-stubs/components/switcher_kis/cover.pyi +0 -1
- homeassistant-stubs/components/switcher_kis/sensor.pyi +0 -1
- homeassistant-stubs/components/switcher_kis/switch.pyi +1 -1
- homeassistant-stubs/components/synology_dsm/sensor.pyi +5 -4
- homeassistant-stubs/components/threshold/__init__.pyi +7 -0
- homeassistant-stubs/components/threshold/binary_sensor.pyi +55 -0
- homeassistant-stubs/components/threshold/config_flow.pyi +19 -0
- homeassistant-stubs/components/threshold/const.pyi +5 -0
- homeassistant-stubs/components/tibber/config_flow.pyi +3 -0
- homeassistant-stubs/components/tibber/sensor.pyi +2 -1
- homeassistant-stubs/components/tplink/light.pyi +1 -1
- homeassistant-stubs/components/tplink_omada/__init__.pyi +1 -0
- homeassistant-stubs/components/tplink_omada/controller.pyi +21 -0
- homeassistant-stubs/components/tplink_omada/coordinator.pyi +3 -4
- homeassistant-stubs/components/tplink_omada/entity.pyi +6 -4
- homeassistant-stubs/components/tplink_omada/switch.pyi +4 -6
- homeassistant-stubs/components/tplink_omada/update.pyi +43 -0
- homeassistant-stubs/components/tradfri/sensor.pyi +0 -1
- homeassistant-stubs/components/tts/__init__.pyi +2 -1
- homeassistant-stubs/components/unifi/__init__.pyi +33 -0
- homeassistant-stubs/components/unifi/config_flow.pyi +46 -0
- homeassistant-stubs/components/unifi/const.pyi +30 -0
- homeassistant-stubs/components/unifi/controller.pyi +77 -0
- homeassistant-stubs/components/unifi/device_tracker.pyi +70 -0
- homeassistant-stubs/components/unifi/diagnostics.pyi +19 -0
- homeassistant-stubs/components/unifi/entity.pyi +58 -0
- homeassistant-stubs/components/unifi/errors.pyi +8 -0
- homeassistant-stubs/components/unifi/sensor.pyi +37 -0
- homeassistant-stubs/components/unifi/services.pyi +17 -0
- homeassistant-stubs/components/unifi/switch.pyi +55 -0
- homeassistant-stubs/components/unifi/update.pyi +1 -1
- homeassistant-stubs/components/unifiprotect/select.pyi +2 -2
- homeassistant-stubs/components/vacuum/device_action.pyi +0 -1
- homeassistant-stubs/components/vacuum/device_condition.pyi +1 -1
- homeassistant-stubs/components/vacuum/device_trigger.pyi +0 -1
- homeassistant-stubs/components/velbus/__init__.pyi +0 -2
- homeassistant-stubs/components/velbus/light.pyi +1 -1
- homeassistant-stubs/components/velbus/select.pyi +21 -0
- homeassistant-stubs/components/water_heater/device_action.pyi +0 -1
- homeassistant-stubs/components/weather/__init__.pyi +2 -23
- homeassistant-stubs/components/weather/const.pyi +25 -0
- homeassistant-stubs/components/weather/websocket_api.pyi +7 -0
- homeassistant-stubs/components/webostv/trigger.pyi +3 -3
- homeassistant-stubs/components/webostv/triggers/__init__.pyi +0 -5
- homeassistant-stubs/components/websocket_api/commands.pyi +2 -2
- homeassistant-stubs/components/websocket_api/connection.pyi +7 -1
- homeassistant-stubs/components/zwave_js/__init__.pyi +4 -4
- homeassistant-stubs/components/zwave_js/api.pyi +0 -1
- homeassistant-stubs/components/zwave_js/device_action.pyi +0 -1
- homeassistant-stubs/components/zwave_js/device_trigger.pyi +0 -1
- homeassistant-stubs/components/zwave_js/diagnostics.pyi +2 -1
- homeassistant-stubs/components/zwave_js/discovery.pyi +1 -1
- homeassistant-stubs/components/zwave_js/update.pyi +18 -8
- homeassistant-stubs/config_entries.pyi +4 -1
- homeassistant-stubs/core.pyi +4 -3
- homeassistant-stubs/helpers/condition.pyi +11 -3
- homeassistant-stubs/helpers/config_validation.pyi +1 -1
- homeassistant-stubs/helpers/debounce.pyi +1 -0
- homeassistant-stubs/helpers/device_registry.pyi +1 -1
- homeassistant-stubs/helpers/entity.pyi +1 -0
- homeassistant-stubs/helpers/entity_platform.pyi +2 -1
- homeassistant-stubs/helpers/entity_registry.pyi +9 -1
- homeassistant-stubs/helpers/event.pyi +3 -1
- homeassistant-stubs/helpers/httpx_client.pyi +1 -0
- homeassistant-stubs/helpers/integration_platform.pyi +3 -3
- homeassistant-stubs/helpers/script.pyi +5 -3
- homeassistant-stubs/helpers/selector.pyi +29 -12
- homeassistant-stubs/helpers/service.pyi +11 -0
- homeassistant-stubs/helpers/template.pyi +24 -3
- homeassistant-stubs/scripts/check_config.pyi +0 -1
- homeassistant-stubs/util/ssl.pyi +8 -0
- homeassistant-stubs/util/ulid.pyi +2 -1
- homeassistant-stubs/util/yaml/dumper.pyi +1 -1
- homeassistant-stubs/util/yaml/loader.pyi +4 -5
- homeassistant-stubs/util/yaml/objects.pyi +1 -0
- {homeassistant_stubs-2023.3.6.dist-info → homeassistant_stubs-2023.4.0b1.dist-info}/METADATA +2 -2
- {homeassistant_stubs-2023.3.6.dist-info → homeassistant_stubs-2023.4.0b1.dist-info}/RECORD +331 -265
- homeassistant-stubs/components/mysensors/notify.pyi +0 -23
- homeassistant-stubs/components/recorder/models.pyi +0 -148
- {homeassistant_stubs-2023.3.6.dist-info → homeassistant_stubs-2023.4.0b1.dist-info}/LICENSE +0 -0
- {homeassistant_stubs-2023.3.6.dist-info → homeassistant_stubs-2023.4.0b1.dist-info}/WHEEL +0 -0
@@ -1,8 +1,11 @@
|
|
1
|
-
from
|
2
|
-
from
|
3
|
-
from
|
4
|
-
from
|
5
|
-
from .
|
1
|
+
from ... import recorder as recorder
|
2
|
+
from ..db_schema import RecorderRuns as RecorderRuns, StateAttributes as StateAttributes, States as States
|
3
|
+
from ..filters import Filters as Filters
|
4
|
+
from ..models import LazyState as LazyState, process_datetime_to_timestamp as process_datetime_to_timestamp, process_timestamp as process_timestamp, process_timestamp_to_utc_isoformat as process_timestamp_to_utc_isoformat, row_to_compressed_state as row_to_compressed_state
|
5
|
+
from ..models.legacy import LazyStatePreSchema31 as LazyStatePreSchema31, row_to_compressed_state_pre_schema_31 as row_to_compressed_state_pre_schema_31
|
6
|
+
from ..util import execute_stmt_lambda_element as execute_stmt_lambda_element, session_scope as session_scope
|
7
|
+
from .common import _schema_version as _schema_version
|
8
|
+
from .const import IGNORE_DOMAINS_ENTITY_ID_LIKE as IGNORE_DOMAINS_ENTITY_ID_LIKE, LAST_CHANGED_KEY as LAST_CHANGED_KEY, NEED_ATTRIBUTE_DOMAINS as NEED_ATTRIBUTE_DOMAINS, SIGNIFICANT_DOMAINS as SIGNIFICANT_DOMAINS, SIGNIFICANT_DOMAINS_ENTITY_ID_LIKE as SIGNIFICANT_DOMAINS_ENTITY_ID_LIKE, STATE_KEY as STATE_KEY
|
6
9
|
from _typeshed import Incomplete
|
7
10
|
from collections.abc import Callable as Callable, Iterable, MutableMapping
|
8
11
|
from datetime import datetime
|
@@ -16,13 +19,6 @@ from sqlalchemy.sql.lambdas import StatementLambdaElement as StatementLambdaElem
|
|
16
19
|
from typing import Any
|
17
20
|
|
18
21
|
_LOGGER: Incomplete
|
19
|
-
STATE_KEY: str
|
20
|
-
LAST_CHANGED_KEY: str
|
21
|
-
SIGNIFICANT_DOMAINS: Incomplete
|
22
|
-
SIGNIFICANT_DOMAINS_ENTITY_ID_LIKE: Incomplete
|
23
|
-
IGNORE_DOMAINS: Incomplete
|
24
|
-
IGNORE_DOMAINS_ENTITY_ID_LIKE: Incomplete
|
25
|
-
NEED_ATTRIBUTE_DOMAINS: Incomplete
|
26
22
|
_BASE_STATES: Incomplete
|
27
23
|
_BASE_STATES_NO_LAST_CHANGED: Incomplete
|
28
24
|
_QUERY_STATE_NO_ATTR: Incomplete
|
@@ -40,8 +36,7 @@ _QUERY_STATES_NO_LAST_CHANGED: Incomplete
|
|
40
36
|
_FIELD_MAP: Incomplete
|
41
37
|
_FIELD_MAP_PRE_SCHEMA_31: Incomplete
|
42
38
|
|
43
|
-
def
|
44
|
-
def lambda_stmt_and_join_attributes(schema_version: int, no_attributes: bool, include_last_changed: bool = ...) -> tuple[StatementLambdaElement, bool]: ...
|
39
|
+
def _lambda_stmt_and_join_attributes(schema_version: int, no_attributes: bool, include_last_changed: bool = ...) -> tuple[StatementLambdaElement, bool]: ...
|
45
40
|
def get_significant_states(hass: HomeAssistant, start_time: datetime, end_time: Union[datetime, None] = ..., entity_ids: Union[list[str], None] = ..., filters: Union[Filters, None] = ..., include_start_time_state: bool = ..., significant_changes_only: bool = ..., minimal_response: bool = ..., no_attributes: bool = ..., compressed_state_format: bool = ...) -> MutableMapping[str, list[Union[State, dict[str, Any]]]]: ...
|
46
41
|
def _ignore_domains_filter(query: Query) -> Query: ...
|
47
42
|
def _significant_states_stmt(schema_version: int, start_time: datetime, end_time: Union[datetime, None], entity_ids: Union[list[str], None], filters: Union[Filters, None], significant_changes_only: bool, no_attributes: bool) -> StatementLambdaElement: ...
|
@@ -0,0 +1,41 @@
|
|
1
|
+
from ... import recorder as recorder
|
2
|
+
from ..db_schema import RecorderRuns as RecorderRuns, StateAttributes as StateAttributes, States as States, StatesMeta as StatesMeta
|
3
|
+
from ..filters import Filters as Filters
|
4
|
+
from ..models import LazyState as LazyState, extract_metadata_ids as extract_metadata_ids, process_timestamp as process_timestamp, row_to_compressed_state as row_to_compressed_state
|
5
|
+
from ..util import execute_stmt_lambda_element as execute_stmt_lambda_element, session_scope as session_scope
|
6
|
+
from .const import IGNORE_DOMAINS_ENTITY_ID_LIKE as IGNORE_DOMAINS_ENTITY_ID_LIKE, LAST_CHANGED_KEY as LAST_CHANGED_KEY, NEED_ATTRIBUTE_DOMAINS as NEED_ATTRIBUTE_DOMAINS, SIGNIFICANT_DOMAINS as SIGNIFICANT_DOMAINS, SIGNIFICANT_DOMAINS_ENTITY_ID_LIKE as SIGNIFICANT_DOMAINS_ENTITY_ID_LIKE, STATE_KEY as STATE_KEY
|
7
|
+
from _typeshed import Incomplete
|
8
|
+
from collections.abc import Callable as Callable, Iterable, MutableMapping
|
9
|
+
from datetime import datetime
|
10
|
+
from homeassistant.const import COMPRESSED_STATE_LAST_UPDATED as COMPRESSED_STATE_LAST_UPDATED, COMPRESSED_STATE_STATE as COMPRESSED_STATE_STATE
|
11
|
+
from homeassistant.core import HomeAssistant as HomeAssistant, State as State, split_entity_id as split_entity_id
|
12
|
+
from sqlalchemy import Column as Column
|
13
|
+
from sqlalchemy.engine.row import Row as Row
|
14
|
+
from sqlalchemy.orm.query import Query as Query
|
15
|
+
from sqlalchemy.orm.session import Session as Session
|
16
|
+
from sqlalchemy.sql.lambdas import StatementLambdaElement as StatementLambdaElement
|
17
|
+
from typing import Any
|
18
|
+
|
19
|
+
_BASE_STATES: Incomplete
|
20
|
+
_BASE_STATES_NO_LAST_CHANGED: Incomplete
|
21
|
+
_QUERY_STATE_NO_ATTR: Incomplete
|
22
|
+
_QUERY_STATE_NO_ATTR_NO_LAST_CHANGED: Incomplete
|
23
|
+
_QUERY_STATES: Incomplete
|
24
|
+
_QUERY_STATES_NO_LAST_CHANGED: Incomplete
|
25
|
+
_FIELD_MAP: Incomplete
|
26
|
+
|
27
|
+
def _lambda_stmt_and_join_attributes(no_attributes: bool, include_last_changed: bool = ...) -> tuple[StatementLambdaElement, bool]: ...
|
28
|
+
def get_significant_states(hass: HomeAssistant, start_time: datetime, end_time: Union[datetime, None] = ..., entity_ids: Union[list[str], None] = ..., filters: Union[Filters, None] = ..., include_start_time_state: bool = ..., significant_changes_only: bool = ..., minimal_response: bool = ..., no_attributes: bool = ..., compressed_state_format: bool = ...) -> MutableMapping[str, list[Union[State, dict[str, Any]]]]: ...
|
29
|
+
def _ignore_domains_filter(query: Query) -> Query: ...
|
30
|
+
def _significant_states_stmt(start_time: datetime, end_time: Union[datetime, None], metadata_ids: Union[list[int], None], metadata_ids_in_significant_domains: list[int], filters: Union[Filters, None], significant_changes_only: bool, no_attributes: bool) -> StatementLambdaElement: ...
|
31
|
+
def get_significant_states_with_session(hass: HomeAssistant, session: Session, start_time: datetime, end_time: Union[datetime, None] = ..., entity_ids: Union[list[str], None] = ..., filters: Union[Filters, None] = ..., include_start_time_state: bool = ..., significant_changes_only: bool = ..., minimal_response: bool = ..., no_attributes: bool = ..., compressed_state_format: bool = ...) -> MutableMapping[str, list[Union[State, dict[str, Any]]]]: ...
|
32
|
+
def get_full_significant_states_with_session(hass: HomeAssistant, session: Session, start_time: datetime, end_time: Union[datetime, None] = ..., entity_ids: Union[list[str], None] = ..., filters: Union[Filters, None] = ..., include_start_time_state: bool = ..., significant_changes_only: bool = ..., no_attributes: bool = ...) -> MutableMapping[str, list[State]]: ...
|
33
|
+
def _state_changed_during_period_stmt(start_time: datetime, end_time: Union[datetime, None], metadata_id: Union[int, None], no_attributes: bool, descending: bool, limit: Union[int, None]) -> StatementLambdaElement: ...
|
34
|
+
def state_changes_during_period(hass: HomeAssistant, start_time: datetime, end_time: Union[datetime, None] = ..., entity_id: Union[str, None] = ..., no_attributes: bool = ..., descending: bool = ..., limit: Union[int, None] = ..., include_start_time_state: bool = ...) -> MutableMapping[str, list[State]]: ...
|
35
|
+
def _get_last_state_changes_stmt(number_of_states: int, metadata_id: int) -> StatementLambdaElement: ...
|
36
|
+
def get_last_state_changes(hass: HomeAssistant, number_of_states: int, entity_id: str) -> MutableMapping[str, list[State]]: ...
|
37
|
+
def _get_states_for_entities_stmt(run_start: datetime, utc_point_in_time: datetime, metadata_ids: list[int], no_attributes: bool) -> StatementLambdaElement: ...
|
38
|
+
def _get_states_for_all_stmt(run_start: datetime, utc_point_in_time: datetime, filters: Union[Filters, None], no_attributes: bool) -> StatementLambdaElement: ...
|
39
|
+
def _get_rows_with_session(hass: HomeAssistant, session: Session, utc_point_in_time: datetime, entity_ids: Union[list[str], None] = ..., entity_id_to_metadata_id: Union[dict[str, Union[int, None]], None] = ..., run: Union[RecorderRuns, None] = ..., filters: Union[Filters, None] = ..., no_attributes: bool = ...) -> Iterable[Row]: ...
|
40
|
+
def _get_single_entity_states_stmt(utc_point_in_time: datetime, metadata_id: int, no_attributes: bool = ...) -> StatementLambdaElement: ...
|
41
|
+
def _sorted_states_to_dict(hass: HomeAssistant, session: Session, states: Iterable[Row], start_time: datetime, entity_ids: Union[list[str], None], entity_id_to_metadata_id: Union[dict[str, Union[int, None]], None], filters: Union[Filters, None] = ..., include_start_time_state: bool = ..., minimal_response: bool = ..., no_attributes: bool = ..., compressed_state_format: bool = ...) -> MutableMapping[str, list[Union[State, dict[str, Any]]]]: ...
|
@@ -1,44 +1,72 @@
|
|
1
1
|
from . import Recorder as Recorder
|
2
|
+
from .auto_repairs.statistics.duplicates import delete_statistics_duplicates as delete_statistics_duplicates, delete_statistics_meta_duplicates as delete_statistics_meta_duplicates
|
2
3
|
from .const import SupportedDialect as SupportedDialect
|
3
|
-
from .db_schema import Base as Base, SCHEMA_VERSION as SCHEMA_VERSION, STATISTICS_TABLES as STATISTICS_TABLES, SchemaChanges as SchemaChanges, Statistics as Statistics, StatisticsMeta as StatisticsMeta, StatisticsRuns as StatisticsRuns, StatisticsShortTerm as StatisticsShortTerm, TABLE_STATES as TABLE_STATES
|
4
|
+
from .db_schema import Base as Base, CONTEXT_ID_BIN_MAX_LENGTH as CONTEXT_ID_BIN_MAX_LENGTH, DOUBLE_PRECISION_TYPE_SQL as DOUBLE_PRECISION_TYPE_SQL, EventTypes as EventTypes, Events as Events, LEGACY_STATES_EVENT_ID_INDEX as LEGACY_STATES_EVENT_ID_INDEX, MYSQL_COLLATE as MYSQL_COLLATE, MYSQL_DEFAULT_CHARSET as MYSQL_DEFAULT_CHARSET, SCHEMA_VERSION as SCHEMA_VERSION, STATISTICS_TABLES as STATISTICS_TABLES, SchemaChanges as SchemaChanges, States as States, StatesMeta as StatesMeta, Statistics as Statistics, StatisticsMeta as StatisticsMeta, StatisticsRuns as StatisticsRuns, StatisticsShortTerm as StatisticsShortTerm, TABLE_STATES as TABLE_STATES
|
4
5
|
from .models import process_timestamp as process_timestamp
|
5
|
-
from .
|
6
|
+
from .queries import batch_cleanup_entity_ids as batch_cleanup_entity_ids, find_entity_ids_to_migrate as find_entity_ids_to_migrate, find_event_type_to_migrate as find_event_type_to_migrate, find_events_context_ids_to_migrate as find_events_context_ids_to_migrate, find_states_context_ids_to_migrate as find_states_context_ids_to_migrate, has_used_states_event_ids as has_used_states_event_ids
|
7
|
+
from .statistics import get_start_time as get_start_time
|
6
8
|
from .tasks import CommitTask as CommitTask, PostSchemaMigrationTask as PostSchemaMigrationTask, StatisticsTimestampMigrationCleanupTask as StatisticsTimestampMigrationCleanupTask
|
7
|
-
from .util import database_job_retry_wrapper as database_job_retry_wrapper, session_scope as session_scope
|
9
|
+
from .util import database_job_retry_wrapper as database_job_retry_wrapper, get_index_by_name as get_index_by_name, retryable_database_job as retryable_database_job, session_scope as session_scope
|
8
10
|
from _typeshed import Incomplete
|
9
11
|
from collections.abc import Callable as Callable, Iterable
|
10
12
|
from homeassistant.core import HomeAssistant as HomeAssistant
|
13
|
+
from homeassistant.util.enum import try_parse_enum as try_parse_enum
|
14
|
+
from homeassistant.util.ulid import ulid_to_bytes as ulid_to_bytes
|
11
15
|
from sqlalchemy.engine import CursorResult as CursorResult, Engine as Engine
|
12
16
|
from sqlalchemy.orm.session import Session as Session
|
13
17
|
|
14
18
|
LIVE_MIGRATION_MIN_SCHEMA_VERSION: int
|
19
|
+
_EMPTY_CONTEXT_ID: Incomplete
|
20
|
+
_EMPTY_ENTITY_ID: str
|
21
|
+
_EMPTY_EVENT_TYPE: str
|
15
22
|
_LOGGER: Incomplete
|
16
23
|
|
24
|
+
class _ColumnTypesForDialect:
|
25
|
+
big_int_type: str
|
26
|
+
timestamp_type: str
|
27
|
+
context_bin_type: str
|
28
|
+
def __init__(self, big_int_type, timestamp_type, context_bin_type) -> None: ...
|
29
|
+
|
30
|
+
_MYSQL_COLUMN_TYPES: Incomplete
|
31
|
+
_POSTGRESQL_COLUMN_TYPES: Incomplete
|
32
|
+
_SQLITE_COLUMN_TYPES: Incomplete
|
33
|
+
_COLUMN_TYPES_FOR_DIALECT: dict[Union[SupportedDialect, None], _ColumnTypesForDialect]
|
34
|
+
|
17
35
|
def raise_if_exception_missing_str(ex: Exception, match_substrs: Iterable[str]) -> None: ...
|
18
36
|
def _get_schema_version(session: Session) -> Union[int, None]: ...
|
19
37
|
def get_schema_version(session_maker: Callable[[], Session]) -> Union[int, None]: ...
|
20
38
|
|
21
39
|
class SchemaValidationStatus:
|
22
40
|
current_version: int
|
23
|
-
|
41
|
+
schema_errors: set[str]
|
24
42
|
valid: bool
|
25
|
-
def __init__(self, current_version,
|
43
|
+
def __init__(self, current_version, schema_errors, valid) -> None: ...
|
26
44
|
|
27
45
|
def _schema_is_current(current_version: int) -> bool: ...
|
28
46
|
def validate_db_schema(hass: HomeAssistant, instance: Recorder, session_maker: Callable[[], Session]) -> Union[SchemaValidationStatus, None]: ...
|
47
|
+
def _find_schema_errors(hass: HomeAssistant, instance: Recorder, session_maker: Callable[[], Session]) -> set[str]: ...
|
29
48
|
def live_migration(schema_status: SchemaValidationStatus) -> bool: ...
|
30
49
|
def migrate_schema(instance: Recorder, hass: HomeAssistant, engine: Engine, session_maker: Callable[[], Session], schema_status: SchemaValidationStatus) -> None: ...
|
31
50
|
def _create_index(session_maker: Callable[[], Session], table_name: str, index_name: str) -> None: ...
|
32
|
-
def
|
51
|
+
def _execute_or_collect_error(session_maker: Callable[[], Session], query: str, errors: list[str]) -> bool: ...
|
52
|
+
def _drop_index(session_maker: Callable[[], Session], table_name: str, index_name: str, quiet: Union[bool, None] = ...) -> None: ...
|
33
53
|
def _add_columns(session_maker: Callable[[], Session], table_name: str, columns_def: list[str]) -> None: ...
|
34
54
|
def _modify_columns(session_maker: Callable[[], Session], engine: Engine, table_name: str, columns_def: list[str]) -> None: ...
|
35
55
|
def _update_states_table_with_foreign_key_options(session_maker: Callable[[], Session], engine: Engine) -> None: ...
|
36
56
|
def _drop_foreign_key_constraints(session_maker: Callable[[], Session], engine: Engine, table: str, columns: list[str]) -> None: ...
|
37
57
|
def _apply_update(instance: Recorder, hass: HomeAssistant, engine: Engine, session_maker: Callable[[], Session], new_version: int, old_version: int) -> None: ...
|
58
|
+
def _correct_table_character_set_and_collation(table: str, session_maker: Callable[[], Session]) -> None: ...
|
38
59
|
def post_schema_migration(instance: Recorder, old_version: int, new_version: int) -> None: ...
|
39
60
|
def _wipe_old_string_statistics_columns(instance: Recorder) -> None: ...
|
40
61
|
def _wipe_old_string_time_columns(instance: Recorder, engine: Engine, session: Session) -> None: ...
|
41
62
|
def _migrate_columns_to_timestamp(session_maker: Callable[[], Session], engine: Engine) -> None: ...
|
42
63
|
def _migrate_statistics_columns_to_timestamp(session_maker: Callable[[], Session], engine: Engine) -> None: ...
|
64
|
+
def _context_id_to_bytes(context_id: Union[str, None]) -> Union[bytes, None]: ...
|
65
|
+
def migrate_states_context_ids(instance: Recorder) -> bool: ...
|
66
|
+
def migrate_events_context_ids(instance: Recorder) -> bool: ...
|
67
|
+
def migrate_event_type_ids(instance: Recorder) -> bool: ...
|
68
|
+
def migrate_entity_ids(instance: Recorder) -> bool: ...
|
69
|
+
def post_migrate_entity_ids(instance: Recorder) -> bool: ...
|
70
|
+
def cleanup_legacy_states_event_ids(instance: Recorder) -> bool: ...
|
43
71
|
def _initialize_database(session: Session) -> bool: ...
|
44
72
|
def initialize_database(session_maker: Callable[[], Session]) -> bool: ...
|
@@ -0,0 +1,5 @@
|
|
1
|
+
from .context import bytes_to_ulid_or_none as bytes_to_ulid_or_none, bytes_to_uuid_hex_or_none as bytes_to_uuid_hex_or_none, ulid_to_bytes_or_none as ulid_to_bytes_or_none, uuid_hex_to_bytes_or_none as uuid_hex_to_bytes_or_none
|
2
|
+
from .database import DatabaseEngine as DatabaseEngine, DatabaseOptimizer as DatabaseOptimizer, UnsupportedDialect as UnsupportedDialect
|
3
|
+
from .state import LazyState as LazyState, extract_metadata_ids as extract_metadata_ids, row_to_compressed_state as row_to_compressed_state
|
4
|
+
from .statistics import CalendarStatisticPeriod as CalendarStatisticPeriod, FixedStatisticPeriod as FixedStatisticPeriod, RollingWindowStatisticPeriod as RollingWindowStatisticPeriod, StatisticData as StatisticData, StatisticDataTimestamp as StatisticDataTimestamp, StatisticMetaData as StatisticMetaData, StatisticPeriod as StatisticPeriod, StatisticResult as StatisticResult
|
5
|
+
from .time import datetime_to_timestamp_or_none as datetime_to_timestamp_or_none, process_datetime_to_timestamp as process_datetime_to_timestamp, process_timestamp as process_timestamp, process_timestamp_to_utc_isoformat as process_timestamp_to_utc_isoformat, timestamp_to_datetime_or_none as timestamp_to_datetime_or_none
|
@@ -0,0 +1,6 @@
|
|
1
|
+
from homeassistant.util.ulid import bytes_to_ulid as bytes_to_ulid, ulid_to_bytes as ulid_to_bytes
|
2
|
+
|
3
|
+
def ulid_to_bytes_or_none(ulid: Union[str, None]) -> Union[bytes, None]: ...
|
4
|
+
def bytes_to_ulid_or_none(_bytes: Union[bytes, None]) -> Union[str, None]: ...
|
5
|
+
def uuid_hex_to_bytes_or_none(uuid_hex: Union[str, None]) -> Union[bytes, None]: ...
|
6
|
+
def bytes_to_uuid_hex_or_none(_bytes: Union[bytes, None]) -> Union[str, None]: ...
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from ..const import SupportedDialect as SupportedDialect
|
2
|
+
from awesomeversion import AwesomeVersion as AwesomeVersion
|
3
|
+
|
4
|
+
class UnsupportedDialect(Exception): ...
|
5
|
+
|
6
|
+
class DatabaseEngine:
|
7
|
+
dialect: SupportedDialect
|
8
|
+
optimizer: DatabaseOptimizer
|
9
|
+
version: Union[AwesomeVersion, None]
|
10
|
+
def __init__(self, dialect, optimizer, version) -> None: ...
|
11
|
+
|
12
|
+
class DatabaseOptimizer:
|
13
|
+
slow_range_in_select: bool
|
14
|
+
def __init__(self, slow_range_in_select) -> None: ...
|
@@ -0,0 +1,39 @@
|
|
1
|
+
from .state_attributes import decode_attributes_from_row as decode_attributes_from_row
|
2
|
+
from .time import process_datetime_to_timestamp as process_datetime_to_timestamp, process_timestamp as process_timestamp, process_timestamp_to_utc_isoformat as process_timestamp_to_utc_isoformat
|
3
|
+
from _typeshed import Incomplete
|
4
|
+
from datetime import datetime
|
5
|
+
from homeassistant.const import COMPRESSED_STATE_ATTRIBUTES as COMPRESSED_STATE_ATTRIBUTES, 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
|
6
|
+
from homeassistant.core import Context as Context, State as State
|
7
|
+
from sqlalchemy.engine.row import Row as Row
|
8
|
+
from typing import Any
|
9
|
+
|
10
|
+
class LazyStatePreSchema31(State):
|
11
|
+
__slots__: Incomplete
|
12
|
+
_row: Incomplete
|
13
|
+
entity_id: Incomplete
|
14
|
+
state: Incomplete
|
15
|
+
_attributes: Incomplete
|
16
|
+
_last_changed: Incomplete
|
17
|
+
_last_updated: Incomplete
|
18
|
+
_context: Incomplete
|
19
|
+
attr_cache: Incomplete
|
20
|
+
def __init__(self, row: Row, attr_cache: dict[str, dict[str, Any]], start_time: Union[datetime, None]) -> None: ...
|
21
|
+
@property
|
22
|
+
def attributes(self) -> dict[str, Any]: ...
|
23
|
+
@attributes.setter
|
24
|
+
def attributes(self, value: dict[str, Any]) -> None: ...
|
25
|
+
@property
|
26
|
+
def context(self) -> Context: ...
|
27
|
+
@context.setter
|
28
|
+
def context(self, value: Context) -> None: ...
|
29
|
+
@property
|
30
|
+
def last_changed(self) -> datetime: ...
|
31
|
+
@last_changed.setter
|
32
|
+
def last_changed(self, value: datetime) -> None: ...
|
33
|
+
@property
|
34
|
+
def last_updated(self) -> datetime: ...
|
35
|
+
@last_updated.setter
|
36
|
+
def last_updated(self, value: datetime) -> None: ...
|
37
|
+
def as_dict(self) -> dict[str, Any]: ...
|
38
|
+
|
39
|
+
def row_to_compressed_state_pre_schema_31(row: Row, attr_cache: dict[str, dict[str, Any]], start_time: Union[datetime, None]) -> dict[str, Any]: ...
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from .state_attributes import decode_attributes_from_row as decode_attributes_from_row
|
2
|
+
from .time import process_timestamp as process_timestamp
|
3
|
+
from _typeshed import Incomplete
|
4
|
+
from datetime import datetime
|
5
|
+
from homeassistant.const import COMPRESSED_STATE_ATTRIBUTES as COMPRESSED_STATE_ATTRIBUTES, 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
|
6
|
+
from homeassistant.core import Context as Context, State as State
|
7
|
+
from sqlalchemy.engine.row import Row as Row
|
8
|
+
from typing import Any
|
9
|
+
|
10
|
+
_LOGGER: Incomplete
|
11
|
+
|
12
|
+
def extract_metadata_ids(entity_id_to_metadata_id: dict[str, Union[int, None]]) -> list[int]: ...
|
13
|
+
|
14
|
+
class LazyState(State):
|
15
|
+
__slots__: Incomplete
|
16
|
+
_row: Incomplete
|
17
|
+
entity_id: Incomplete
|
18
|
+
state: Incomplete
|
19
|
+
_attributes: Incomplete
|
20
|
+
_last_updated_ts: Incomplete
|
21
|
+
_last_changed_ts: Incomplete
|
22
|
+
_context: Incomplete
|
23
|
+
attr_cache: Incomplete
|
24
|
+
def __init__(self, row: Row, attr_cache: dict[str, dict[str, Any]], start_time: Union[datetime, None], entity_id: Union[str, None] = ...) -> None: ...
|
25
|
+
@property
|
26
|
+
def attributes(self) -> dict[str, Any]: ...
|
27
|
+
@attributes.setter
|
28
|
+
def attributes(self, value: dict[str, Any]) -> None: ...
|
29
|
+
@property
|
30
|
+
def context(self) -> Context: ...
|
31
|
+
@context.setter
|
32
|
+
def context(self, value: Context) -> None: ...
|
33
|
+
@property
|
34
|
+
def last_changed(self) -> datetime: ...
|
35
|
+
@last_changed.setter
|
36
|
+
def last_changed(self, value: datetime) -> None: ...
|
37
|
+
@property
|
38
|
+
def last_updated(self) -> datetime: ...
|
39
|
+
@last_updated.setter
|
40
|
+
def last_updated(self, value: datetime) -> None: ...
|
41
|
+
def as_dict(self) -> dict[str, Any]: ...
|
42
|
+
|
43
|
+
def row_to_compressed_state(row: Row, attr_cache: dict[str, dict[str, Any]], start_time: Union[datetime, None], entity_id: Union[str, None] = ...) -> dict[str, Any]: ...
|
@@ -0,0 +1,9 @@
|
|
1
|
+
from _typeshed import Incomplete
|
2
|
+
from homeassistant.util.json import json_loads_object as json_loads_object
|
3
|
+
from sqlalchemy.engine.row import Row as Row
|
4
|
+
from typing import Any
|
5
|
+
|
6
|
+
EMPTY_JSON_OBJECT: str
|
7
|
+
_LOGGER: Incomplete
|
8
|
+
|
9
|
+
def decode_attributes_from_row(row: Row, attr_cache: dict[str, dict[str, Any]]) -> dict[str, Any]: ...
|
@@ -0,0 +1,50 @@
|
|
1
|
+
from datetime import datetime, timedelta
|
2
|
+
from typing import Literal, TypedDict
|
3
|
+
|
4
|
+
class StatisticResult(TypedDict):
|
5
|
+
meta: StatisticMetaData
|
6
|
+
stat: StatisticData
|
7
|
+
|
8
|
+
class StatisticDataTimestampBase(TypedDict):
|
9
|
+
start_ts: float
|
10
|
+
|
11
|
+
class StatisticDataBase(TypedDict):
|
12
|
+
start: datetime
|
13
|
+
|
14
|
+
class StatisticMixIn(TypedDict):
|
15
|
+
state: float
|
16
|
+
sum: float
|
17
|
+
min: float
|
18
|
+
max: float
|
19
|
+
mean: float
|
20
|
+
|
21
|
+
class StatisticData(StatisticDataBase, StatisticMixIn):
|
22
|
+
last_reset: Union[datetime, None]
|
23
|
+
|
24
|
+
class StatisticDataTimestamp(StatisticDataTimestampBase, StatisticMixIn):
|
25
|
+
last_reset_ts: Union[float, None]
|
26
|
+
|
27
|
+
class StatisticMetaData(TypedDict):
|
28
|
+
has_mean: bool
|
29
|
+
has_sum: bool
|
30
|
+
name: Union[str, None]
|
31
|
+
source: str
|
32
|
+
statistic_id: str
|
33
|
+
unit_of_measurement: Union[str, None]
|
34
|
+
|
35
|
+
class CalendarStatisticPeriod(TypedDict):
|
36
|
+
period: Literal['hour', 'day', 'week', 'month', 'year']
|
37
|
+
offset: int
|
38
|
+
|
39
|
+
class FixedStatisticPeriod(TypedDict):
|
40
|
+
end_time: datetime
|
41
|
+
start_time: datetime
|
42
|
+
|
43
|
+
class RollingWindowStatisticPeriod(TypedDict):
|
44
|
+
duration: timedelta
|
45
|
+
offset: timedelta
|
46
|
+
|
47
|
+
class StatisticPeriod(TypedDict):
|
48
|
+
calendar: CalendarStatisticPeriod
|
49
|
+
fixed_period: FixedStatisticPeriod
|
50
|
+
rolling_window: RollingWindowStatisticPeriod
|
@@ -0,0 +1,20 @@
|
|
1
|
+
from _typeshed import Incomplete
|
2
|
+
from datetime import datetime
|
3
|
+
from typing import overload
|
4
|
+
|
5
|
+
_LOGGER: Incomplete
|
6
|
+
DB_TIMEZONE: str
|
7
|
+
EMPTY_JSON_OBJECT: str
|
8
|
+
|
9
|
+
|
10
|
+
@overload
|
11
|
+
def process_timestamp(ts: None) -> None: ...
|
12
|
+
@overload
|
13
|
+
def process_timestamp(ts: datetime) -> datetime: ...
|
14
|
+
@overload
|
15
|
+
def process_timestamp_to_utc_isoformat(ts: None) -> None: ...
|
16
|
+
@overload
|
17
|
+
def process_timestamp_to_utc_isoformat(ts: datetime) -> str: ...
|
18
|
+
def process_datetime_to_timestamp(ts: datetime) -> float: ...
|
19
|
+
def datetime_to_timestamp_or_none(dt: Union[datetime, None]) -> Union[float, None]: ...
|
20
|
+
def timestamp_to_datetime_or_none(ts: Union[float, None]) -> Union[datetime, None]: ...
|
@@ -1,15 +1,13 @@
|
|
1
1
|
from . import Recorder as Recorder
|
2
2
|
from .const import SQLITE_MAX_BIND_VARS as SQLITE_MAX_BIND_VARS
|
3
|
-
from .db_schema import Events as Events,
|
3
|
+
from .db_schema import Events as Events, States as States, StatesMeta as StatesMeta
|
4
4
|
from .models import DatabaseEngine as DatabaseEngine
|
5
|
-
from .queries import attributes_ids_exist_in_states as attributes_ids_exist_in_states, attributes_ids_exist_in_states_with_fast_in_distinct as attributes_ids_exist_in_states_with_fast_in_distinct, data_ids_exist_in_events as data_ids_exist_in_events, data_ids_exist_in_events_with_fast_in_distinct as data_ids_exist_in_events_with_fast_in_distinct, delete_event_data_rows as delete_event_data_rows, delete_event_rows as delete_event_rows, delete_recorder_runs_rows as delete_recorder_runs_rows, delete_states_attributes_rows as delete_states_attributes_rows, delete_states_rows as delete_states_rows, delete_statistics_runs_rows as delete_statistics_runs_rows, delete_statistics_short_term_rows as delete_statistics_short_term_rows, disconnect_states_rows as disconnect_states_rows, find_events_to_purge as find_events_to_purge, find_latest_statistics_runs_run_id as find_latest_statistics_runs_run_id, find_legacy_event_state_and_attributes_and_data_ids_to_purge as find_legacy_event_state_and_attributes_and_data_ids_to_purge, find_legacy_row as find_legacy_row, find_short_term_statistics_to_purge as find_short_term_statistics_to_purge, find_states_to_purge as find_states_to_purge, find_statistics_runs_to_purge as find_statistics_runs_to_purge
|
5
|
+
from .queries import attributes_ids_exist_in_states as attributes_ids_exist_in_states, attributes_ids_exist_in_states_with_fast_in_distinct as attributes_ids_exist_in_states_with_fast_in_distinct, data_ids_exist_in_events as data_ids_exist_in_events, data_ids_exist_in_events_with_fast_in_distinct as data_ids_exist_in_events_with_fast_in_distinct, delete_event_data_rows as delete_event_data_rows, delete_event_rows as delete_event_rows, delete_event_types_rows as delete_event_types_rows, delete_recorder_runs_rows as delete_recorder_runs_rows, delete_states_attributes_rows as delete_states_attributes_rows, delete_states_meta_rows as delete_states_meta_rows, delete_states_rows as delete_states_rows, delete_statistics_runs_rows as delete_statistics_runs_rows, delete_statistics_short_term_rows as delete_statistics_short_term_rows, disconnect_states_rows as disconnect_states_rows, find_entity_ids_to_purge as find_entity_ids_to_purge, find_event_types_to_purge as find_event_types_to_purge, find_events_to_purge as find_events_to_purge, find_latest_statistics_runs_run_id as find_latest_statistics_runs_run_id, find_legacy_event_state_and_attributes_and_data_ids_to_purge as find_legacy_event_state_and_attributes_and_data_ids_to_purge, find_legacy_row as find_legacy_row, find_short_term_statistics_to_purge as find_short_term_statistics_to_purge, find_states_to_purge as find_states_to_purge, find_statistics_runs_to_purge as find_statistics_runs_to_purge
|
6
6
|
from .repack import repack_database as repack_database
|
7
7
|
from .util import chunked as chunked, retryable_database_job as retryable_database_job, session_scope as session_scope
|
8
8
|
from _typeshed import Incomplete
|
9
|
-
from collections.abc import Callable as Callable
|
9
|
+
from collections.abc import Callable as Callable
|
10
10
|
from datetime import datetime
|
11
|
-
from homeassistant.const import EVENT_STATE_CHANGED as EVENT_STATE_CHANGED
|
12
|
-
from sqlalchemy.engine.row import Row as Row
|
13
11
|
from sqlalchemy.orm.session import Session as Session
|
14
12
|
|
15
13
|
_LOGGER: Incomplete
|
@@ -31,16 +29,15 @@ def _select_statistics_runs_to_purge(session: Session, purge_before: datetime) -
|
|
31
29
|
def _select_short_term_statistics_to_purge(session: Session, purge_before: datetime) -> list[int]: ...
|
32
30
|
def _select_legacy_event_state_and_attributes_and_data_ids_to_purge(session: Session, purge_before: datetime) -> tuple[set[int], set[int], set[int], set[int]]: ...
|
33
31
|
def _purge_state_ids(instance: Recorder, session: Session, state_ids: set[int]) -> None: ...
|
34
|
-
def _evict_purged_states_from_old_states_cache(instance: Recorder, purged_state_ids: set[int]) -> None: ...
|
35
|
-
def _evict_purged_data_from_data_cache(instance: Recorder, purged_data_ids: set[int]) -> None: ...
|
36
|
-
def _evict_purged_attributes_from_attributes_cache(instance: Recorder, purged_attributes_ids: set[int]) -> None: ...
|
37
32
|
def _purge_batch_attributes_ids(instance: Recorder, session: Session, attributes_ids: set[int]) -> None: ...
|
38
33
|
def _purge_batch_data_ids(instance: Recorder, session: Session, data_ids: set[int]) -> None: ...
|
39
34
|
def _purge_statistics_runs(session: Session, statistics_runs: list[int]) -> None: ...
|
40
35
|
def _purge_short_term_statistics(session: Session, short_term_statistics: list[int]) -> None: ...
|
41
|
-
def _purge_event_ids(session: Session, event_ids:
|
36
|
+
def _purge_event_ids(session: Session, event_ids: set[int]) -> None: ...
|
42
37
|
def _purge_old_recorder_runs(instance: Recorder, session: Session, purge_before: datetime) -> None: ...
|
38
|
+
def _purge_old_event_types(instance: Recorder, session: Session) -> None: ...
|
39
|
+
def _purge_old_entity_ids(instance: Recorder, session: Session) -> None: ...
|
43
40
|
def _purge_filtered_data(instance: Recorder, session: Session) -> bool: ...
|
44
|
-
def _purge_filtered_states(instance: Recorder, session: Session,
|
45
|
-
def _purge_filtered_events(instance: Recorder, session: Session,
|
46
|
-
def purge_entity_data(instance: Recorder, entity_filter: Callable[[str], bool]) -> bool: ...
|
41
|
+
def _purge_filtered_states(instance: Recorder, session: Session, metadata_ids_to_purge: list[str], database_engine: DatabaseEngine, purge_before_timestamp: float) -> bool: ...
|
42
|
+
def _purge_filtered_events(instance: Recorder, session: Session, excluded_event_type_ids: list[int], purge_before_timestamp: float) -> bool: ...
|
43
|
+
def purge_entity_data(instance: Recorder, entity_filter: Callable[[str], bool], purge_before: datetime) -> bool: ...
|
@@ -1,14 +1,16 @@
|
|
1
1
|
from .const import SQLITE_MAX_BIND_VARS as SQLITE_MAX_BIND_VARS
|
2
|
-
from .db_schema import EventData as EventData, Events as Events, RecorderRuns as RecorderRuns, StateAttributes as StateAttributes, States as States, StatisticsRuns as StatisticsRuns, StatisticsShortTerm as StatisticsShortTerm
|
2
|
+
from .db_schema import EventData as EventData, EventTypes as EventTypes, Events as Events, RecorderRuns as RecorderRuns, StateAttributes as StateAttributes, States as States, StatesMeta as StatesMeta, StatisticsRuns as StatisticsRuns, StatisticsShortTerm as StatisticsShortTerm
|
3
3
|
from collections.abc import Iterable
|
4
4
|
from datetime import datetime
|
5
5
|
from sqlalchemy.sql.lambdas import StatementLambdaElement as StatementLambdaElement
|
6
6
|
from sqlalchemy.sql.selectable import Select as Select
|
7
7
|
|
8
|
+
def select_event_type_ids(event_types: tuple[str, ...]) -> Select: ...
|
8
9
|
def get_shared_attributes(hashes: list[int]) -> StatementLambdaElement: ...
|
9
10
|
def get_shared_event_datas(hashes: list[int]) -> StatementLambdaElement: ...
|
10
|
-
def
|
11
|
-
def
|
11
|
+
def find_event_type_ids(event_types: Iterable[str]) -> StatementLambdaElement: ...
|
12
|
+
def find_all_states_metadata_ids() -> StatementLambdaElement: ...
|
13
|
+
def find_states_metadata_ids(entity_ids: Iterable[str]) -> StatementLambdaElement: ...
|
12
14
|
def _state_attrs_exist(attr: Union[int, None]) -> Select: ...
|
13
15
|
def attributes_ids_exist_in_states_with_fast_in_distinct(attributes_ids: Iterable[int]) -> StatementLambdaElement: ...
|
14
16
|
def attributes_ids_exist_in_states(attr1: int, attr2: Union[int, None], attr3: Union[int, None], attr4: Union[int, None], attr5: Union[int, None], attr6: Union[int, None], attr7: Union[int, None], attr8: Union[int, None], attr9: Union[int, None], attr10: Union[int, None], attr11: Union[int, None], attr12: Union[int, None], attr13: Union[int, None], attr14: Union[int, None], attr15: Union[int, None], attr16: Union[int, None], attr17: Union[int, None], attr18: Union[int, None], attr19: Union[int, None], attr20: Union[int, None], attr21: Union[int, None], attr22: Union[int, None], attr23: Union[int, None], attr24: Union[int, None], attr25: Union[int, None], attr26: Union[int, None], attr27: Union[int, None], attr28: Union[int, None], attr29: Union[int, None], attr30: Union[int, None], attr31: Union[int, None], attr32: Union[int, None], attr33: Union[int, None], attr34: Union[int, None], attr35: Union[int, None], attr36: Union[int, None], attr37: Union[int, None], attr38: Union[int, None], attr39: Union[int, None], attr40: Union[int, None], attr41: Union[int, None], attr42: Union[int, None], attr43: Union[int, None], attr44: Union[int, None], attr45: Union[int, None], attr46: Union[int, None], attr47: Union[int, None], attr48: Union[int, None], attr49: Union[int, None], attr50: Union[int, None], attr51: Union[int, None], attr52: Union[int, None], attr53: Union[int, None], attr54: Union[int, None], attr55: Union[int, None], attr56: Union[int, None], attr57: Union[int, None], attr58: Union[int, None], attr59: Union[int, None], attr60: Union[int, None], attr61: Union[int, None], attr62: Union[int, None], attr63: Union[int, None], attr64: Union[int, None], attr65: Union[int, None], attr66: Union[int, None], attr67: Union[int, None], attr68: Union[int, None], attr69: Union[int, None], attr70: Union[int, None], attr71: Union[int, None], attr72: Union[int, None], attr73: Union[int, None], attr74: Union[int, None], attr75: Union[int, None], attr76: Union[int, None], attr77: Union[int, None], attr78: Union[int, None], attr79: Union[int, None], attr80: Union[int, None], attr81: Union[int, None], attr82: Union[int, None], attr83: Union[int, None], attr84: Union[int, None], attr85: Union[int, None], attr86: Union[int, None], attr87: Union[int, None], attr88: Union[int, None], attr89: Union[int, None], attr90: Union[int, None], attr91: Union[int, None], attr92: Union[int, None], attr93: Union[int, None], attr94: Union[int, None], attr95: Union[int, None], attr96: Union[int, None], attr97: Union[int, None], attr98: Union[int, None], attr99: Union[int, None], attr100: Union[int, None]) -> StatementLambdaElement: ...
|
@@ -30,3 +32,17 @@ def find_statistics_runs_to_purge(purge_before: datetime) -> StatementLambdaElem
|
|
30
32
|
def find_latest_statistics_runs_run_id() -> StatementLambdaElement: ...
|
31
33
|
def find_legacy_event_state_and_attributes_and_data_ids_to_purge(purge_before: float) -> StatementLambdaElement: ...
|
32
34
|
def find_legacy_row() -> StatementLambdaElement: ...
|
35
|
+
def find_events_context_ids_to_migrate() -> StatementLambdaElement: ...
|
36
|
+
def find_event_type_to_migrate() -> StatementLambdaElement: ...
|
37
|
+
def find_entity_ids_to_migrate() -> StatementLambdaElement: ...
|
38
|
+
def batch_cleanup_entity_ids() -> StatementLambdaElement: ...
|
39
|
+
def has_used_states_event_ids() -> StatementLambdaElement: ...
|
40
|
+
def has_events_context_ids_to_migrate() -> StatementLambdaElement: ...
|
41
|
+
def has_states_context_ids_to_migrate() -> StatementLambdaElement: ...
|
42
|
+
def has_event_type_to_migrate() -> StatementLambdaElement: ...
|
43
|
+
def has_entity_ids_to_migrate() -> StatementLambdaElement: ...
|
44
|
+
def find_states_context_ids_to_migrate() -> StatementLambdaElement: ...
|
45
|
+
def find_event_types_to_purge() -> StatementLambdaElement: ...
|
46
|
+
def find_entity_ids_to_purge() -> StatementLambdaElement: ...
|
47
|
+
def delete_event_types_rows(event_type_ids: Iterable[int]) -> StatementLambdaElement: ...
|
48
|
+
def delete_states_meta_rows(metadata_ids: Iterable[int]) -> StatementLambdaElement: ...
|
@@ -4,7 +4,7 @@ from .tasks import PurgeEntitiesTask as PurgeEntitiesTask, PurgeTask as PurgeTas
|
|
4
4
|
from _typeshed import Incomplete
|
5
5
|
from homeassistant.core import HomeAssistant as HomeAssistant, ServiceCall as ServiceCall, callback as callback
|
6
6
|
from homeassistant.helpers.entityfilter import generate_filter as generate_filter
|
7
|
-
from homeassistant.helpers.service import async_extract_entity_ids as async_extract_entity_ids
|
7
|
+
from homeassistant.helpers.service import async_extract_entity_ids as async_extract_entity_ids, async_register_admin_service as async_register_admin_service
|
8
8
|
|
9
9
|
SERVICE_PURGE: str
|
10
10
|
SERVICE_PURGE_ENTITIES: str
|