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,36 +1,42 @@
|
|
1
1
|
from . import Recorder as Recorder
|
2
|
-
from .const import DOMAIN as DOMAIN, EVENT_RECORDER_5MIN_STATISTICS_GENERATED as EVENT_RECORDER_5MIN_STATISTICS_GENERATED, EVENT_RECORDER_HOURLY_STATISTICS_GENERATED as EVENT_RECORDER_HOURLY_STATISTICS_GENERATED,
|
3
|
-
from .db_schema import STATISTICS_TABLES as STATISTICS_TABLES, Statistics as Statistics, StatisticsBase as StatisticsBase,
|
4
|
-
from .models import StatisticData as StatisticData, StatisticDataTimestamp as StatisticDataTimestamp, StatisticMetaData as StatisticMetaData, StatisticResult as StatisticResult, datetime_to_timestamp_or_none as datetime_to_timestamp_or_none
|
5
|
-
from .util import
|
2
|
+
from .const import DOMAIN as DOMAIN, EVENT_RECORDER_5MIN_STATISTICS_GENERATED as EVENT_RECORDER_5MIN_STATISTICS_GENERATED, EVENT_RECORDER_HOURLY_STATISTICS_GENERATED as EVENT_RECORDER_HOURLY_STATISTICS_GENERATED, INTEGRATION_PLATFORM_COMPILE_STATISTICS as INTEGRATION_PLATFORM_COMPILE_STATISTICS, INTEGRATION_PLATFORM_LIST_STATISTIC_IDS as INTEGRATION_PLATFORM_LIST_STATISTIC_IDS, INTEGRATION_PLATFORM_VALIDATE_STATISTICS as INTEGRATION_PLATFORM_VALIDATE_STATISTICS, SupportedDialect as SupportedDialect
|
3
|
+
from .db_schema import STATISTICS_TABLES as STATISTICS_TABLES, Statistics as Statistics, StatisticsBase as StatisticsBase, StatisticsRuns as StatisticsRuns, StatisticsShortTerm as StatisticsShortTerm
|
4
|
+
from .models import StatisticData as StatisticData, StatisticDataTimestamp as StatisticDataTimestamp, StatisticMetaData as StatisticMetaData, StatisticResult as StatisticResult, datetime_to_timestamp_or_none as datetime_to_timestamp_or_none, process_timestamp as process_timestamp
|
5
|
+
from .util import execute as execute, execute_stmt_lambda_element as execute_stmt_lambda_element, get_instance as get_instance, retryable_database_job as retryable_database_job, session_scope as session_scope
|
6
6
|
from _typeshed import Incomplete
|
7
7
|
from collections.abc import Callable as Callable, Iterable, Sequence
|
8
8
|
from datetime import datetime, timedelta
|
9
9
|
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT as ATTR_UNIT_OF_MEASUREMENT
|
10
|
-
from homeassistant.core import
|
10
|
+
from homeassistant.core import HomeAssistant as HomeAssistant, callback as callback, valid_entity_id as valid_entity_id
|
11
11
|
from homeassistant.exceptions import HomeAssistantError as HomeAssistantError
|
12
|
-
from homeassistant.helpers import entity_registry as entity_registry
|
13
|
-
from homeassistant.helpers.json import JSONEncoder as JSONEncoder
|
14
|
-
from homeassistant.helpers.start import async_at_start as async_at_start
|
15
|
-
from homeassistant.helpers.storage import STORAGE_DIR as STORAGE_DIR
|
16
12
|
from homeassistant.helpers.typing import UNDEFINED as UNDEFINED, UndefinedType as UndefinedType
|
17
13
|
from homeassistant.util.unit_conversion import BaseUnitConverter as BaseUnitConverter, DataRateConverter as DataRateConverter, DistanceConverter as DistanceConverter, ElectricCurrentConverter as ElectricCurrentConverter, ElectricPotentialConverter as ElectricPotentialConverter, EnergyConverter as EnergyConverter, InformationConverter as InformationConverter, MassConverter as MassConverter, PowerConverter as PowerConverter, PressureConverter as PressureConverter, SpeedConverter as SpeedConverter, TemperatureConverter as TemperatureConverter, UnitlessRatioConverter as UnitlessRatioConverter, VolumeConverter as VolumeConverter
|
18
14
|
from sqlalchemy import Select as Select
|
19
|
-
from sqlalchemy.engine import Engine as Engine
|
20
15
|
from sqlalchemy.engine.row import Row
|
21
16
|
from sqlalchemy.orm.session import Session as Session
|
22
17
|
from sqlalchemy.sql.lambdas import StatementLambdaElement as StatementLambdaElement
|
23
18
|
from statistics import mean
|
24
|
-
from typing import Any, Literal
|
19
|
+
from typing import Any, Literal, TypedDict
|
25
20
|
|
26
21
|
QUERY_STATISTICS: Incomplete
|
27
22
|
QUERY_STATISTICS_SHORT_TERM: Incomplete
|
28
23
|
QUERY_STATISTICS_SUMMARY_MEAN: Incomplete
|
29
24
|
QUERY_STATISTICS_SUMMARY_SUM: Incomplete
|
30
|
-
QUERY_STATISTIC_META: Incomplete
|
31
25
|
STATISTIC_UNIT_TO_UNIT_CONVERTER: dict[Union[str, None], type[BaseUnitConverter]]
|
32
26
|
_LOGGER: Incomplete
|
33
27
|
|
28
|
+
class BaseStatisticsRow(TypedDict):
|
29
|
+
start: float
|
30
|
+
|
31
|
+
class StatisticsRow(BaseStatisticsRow):
|
32
|
+
end: float
|
33
|
+
last_reset: Union[float, None]
|
34
|
+
state: Union[float, None]
|
35
|
+
sum: Union[float, None]
|
36
|
+
min: Union[float, None]
|
37
|
+
max: Union[float, None]
|
38
|
+
mean: Union[float, None]
|
39
|
+
|
34
40
|
def _get_unit_class(unit: Union[str, None]) -> Union[str, None]: ...
|
35
41
|
def get_display_unit(hass: HomeAssistant, statistic_id: str, statistic_unit: Union[str, None]) -> Union[str, None]: ...
|
36
42
|
def _get_statistic_to_display_unit_converter(statistic_unit: Union[str, None], state_unit: Union[str, None], requested_units: Union[dict[str, str], None]) -> Union[Callable[[Union[float, None]], Union[float, None]], None]: ...
|
@@ -56,37 +62,33 @@ class ValidationIssue:
|
|
56
62
|
def as_dict(self) -> dict: ...
|
57
63
|
def __init__(self, type, data) -> None: ...
|
58
64
|
|
59
|
-
def async_setup(hass: HomeAssistant) -> None: ...
|
60
65
|
def get_start_time() -> datetime: ...
|
61
|
-
def _update_or_add_metadata(session: Session, new_metadata: StatisticMetaData, old_metadata_dict: dict[str, tuple[int, StatisticMetaData]]) -> int: ...
|
62
|
-
def _find_duplicates(session: Session, table: type[StatisticsBase]) -> tuple[list[int], list[dict]]: ...
|
63
|
-
def _delete_duplicates_from_table(session: Session, table: type[StatisticsBase]) -> tuple[int, list[dict]]: ...
|
64
|
-
def delete_statistics_duplicates(instance: Recorder, hass: HomeAssistant, session: Session) -> None: ...
|
65
|
-
def _find_statistics_meta_duplicates(session: Session) -> list[int]: ...
|
66
|
-
def _delete_statistics_meta_duplicates(session: Session) -> int: ...
|
67
|
-
def delete_statistics_meta_duplicates(session: Session) -> None: ...
|
68
66
|
def _compile_hourly_statistics_summary_mean_stmt(start_time_ts: float, end_time_ts: float) -> StatementLambdaElement: ...
|
69
67
|
def _compile_hourly_statistics_last_sum_stmt(start_time_ts: float, end_time_ts: float) -> StatementLambdaElement: ...
|
70
68
|
def _compile_hourly_statistics(session: Session, start: datetime) -> None: ...
|
69
|
+
def compile_missing_statistics(instance: Recorder) -> bool: ...
|
71
70
|
def compile_statistics(instance: Recorder, start: datetime, fire_events: bool) -> bool: ...
|
71
|
+
def _get_first_id_stmt(start: datetime) -> StatementLambdaElement: ...
|
72
|
+
def _compile_statistics(instance: Recorder, session: Session, start: datetime, fire_events: bool) -> set[str]: ...
|
72
73
|
def _adjust_sum_statistics(session: Session, table: type[StatisticsBase], metadata_id: int, start_time: datetime, adj: float) -> None: ...
|
73
74
|
def _insert_statistics(session: Session, table: type[StatisticsBase], metadata_id: int, statistic: StatisticData) -> None: ...
|
74
75
|
def _update_statistics(session: Session, table: type[StatisticsBase], stat_id: int, statistic: StatisticData) -> None: ...
|
75
|
-
def
|
76
|
-
def
|
77
|
-
def get_metadata(hass: HomeAssistant, *, statistic_ids: Union[list[str], None] = ..., statistic_type: Union[Literal['mean'], Literal['sum'], None] = ..., statistic_source: Union[str, None] = ...) -> dict[str, tuple[int, StatisticMetaData]]: ...
|
78
|
-
def _clear_statistics_with_session(session: Session, statistic_ids: list[str]) -> None: ...
|
76
|
+
def get_metadata_with_session(instance: Recorder, session: Session, *, statistic_ids: Union[set[str], None] = ..., statistic_type: Union[Literal['mean'], Literal['sum'], None] = ..., statistic_source: Union[str, None] = ...) -> dict[str, tuple[int, StatisticMetaData]]: ...
|
77
|
+
def get_metadata(hass: HomeAssistant, *, statistic_ids: Union[set[str], None] = ..., statistic_type: Union[Literal['mean'], Literal['sum'], None] = ..., statistic_source: Union[str, None] = ...) -> dict[str, tuple[int, StatisticMetaData]]: ...
|
79
78
|
def clear_statistics(instance: Recorder, statistic_ids: list[str]) -> None: ...
|
80
79
|
def update_statistics_metadata(instance: Recorder, statistic_id: str, new_statistic_id: Union[str, None, UndefinedType], new_unit_of_measurement: Union[str, None, UndefinedType]) -> None: ...
|
81
|
-
def
|
82
|
-
def
|
80
|
+
async def async_list_statistic_ids(hass: HomeAssistant, statistic_ids: Union[set[str], None] = ..., statistic_type: Union[Literal['mean'], Literal['sum'], None] = ...) -> list[dict]: ...
|
81
|
+
def _statistic_by_id_from_metadata(hass: HomeAssistant, metadata: dict[str, tuple[int, StatisticMetaData]]) -> dict[str, dict[str, Any]]: ...
|
82
|
+
def _flatten_list_statistic_ids_metadata_result(result: dict[str, dict[str, Any]]) -> list[dict]: ...
|
83
|
+
def list_statistic_ids(hass: HomeAssistant, statistic_ids: Union[set[str], None] = ..., statistic_type: Union[Literal['mean'], Literal['sum'], None] = ...) -> list[dict]: ...
|
84
|
+
def _reduce_statistics(stats: dict[str, list[StatisticsRow]], same_period: Callable[[float, float], bool], period_start_end: Callable[[float], tuple[float, float]], period: timedelta, types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
83
85
|
def reduce_day_ts_factory() -> tuple[Callable[[float, float], bool], Callable[[float], tuple[float, float]]]: ...
|
84
|
-
def _reduce_statistics_per_day(stats: dict[str, list[
|
86
|
+
def _reduce_statistics_per_day(stats: dict[str, list[StatisticsRow]], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
85
87
|
def reduce_week_ts_factory() -> tuple[Callable[[float, float], bool], Callable[[float], tuple[float, float]]]: ...
|
86
|
-
def _reduce_statistics_per_week(stats: dict[str, list[
|
88
|
+
def _reduce_statistics_per_week(stats: dict[str, list[StatisticsRow]], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
87
89
|
def reduce_month_ts_factory() -> tuple[Callable[[float, float], bool], Callable[[float], tuple[float, float]]]: ...
|
88
|
-
def _reduce_statistics_per_month(stats: dict[str, list[
|
89
|
-
def _generate_statistics_during_period_stmt(columns: Select, start_time: datetime, end_time: Union[datetime, None], metadata_ids: Union[list[int], None], table: type[StatisticsBase]
|
90
|
+
def _reduce_statistics_per_month(stats: dict[str, list[StatisticsRow]], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
91
|
+
def _generate_statistics_during_period_stmt(columns: Select, start_time: datetime, end_time: Union[datetime, None], metadata_ids: Union[list[int], None], table: type[StatisticsBase]) -> StatementLambdaElement: ...
|
90
92
|
def _generate_max_mean_min_statistic_in_sub_period_stmt(columns: Select, start_time: Union[datetime, None], end_time: Union[datetime, None], table: type[StatisticsBase], metadata_id: int) -> StatementLambdaElement: ...
|
91
93
|
def _get_max_mean_min_statistic_in_sub_period(session: Session, result: dict[str, float], start_time: Union[datetime, None], end_time: Union[datetime, None], table: type[StatisticsBase], types: set[Literal['max', 'mean', 'min', 'change']], metadata_id: int) -> None: ...
|
92
94
|
def _get_max_mean_min_statistic(session: Session, head_start_time: Union[datetime, None], head_end_time: Union[datetime, None], main_start_time: Union[datetime, None], main_end_time: Union[datetime, None], tail_start_time: Union[datetime, None], tail_end_time: Union[datetime, None], tail_only: bool, metadata_id: int, types: set[Literal['max', 'mean', 'min', 'change']]) -> dict[str, Union[float, None]]: ...
|
@@ -94,32 +96,28 @@ def _first_statistic(session: Session, table: type[StatisticsBase], metadata_id:
|
|
94
96
|
def _get_oldest_sum_statistic(session: Session, head_start_time: Union[datetime, None], main_start_time: Union[datetime, None], tail_start_time: Union[datetime, None], oldest_stat: Union[datetime, None], tail_only: bool, metadata_id: int) -> Union[float, None]: ...
|
95
97
|
def _get_newest_sum_statistic(session: Session, head_start_time: Union[datetime, None], head_end_time: Union[datetime, None], main_start_time: Union[datetime, None], main_end_time: Union[datetime, None], tail_start_time: Union[datetime, None], tail_end_time: Union[datetime, None], tail_only: bool, metadata_id: int) -> Union[float, None]: ...
|
96
98
|
def statistic_during_period(hass: HomeAssistant, start_time: Union[datetime, None], end_time: Union[datetime, None], statistic_id: str, types: Union[set[Literal['max', 'mean', 'min', 'change']], None], units: Union[dict[str, str], None]) -> dict[str, Any]: ...
|
97
|
-
def _statistics_during_period_with_session(hass: HomeAssistant, session: Session, start_time: datetime, end_time: Union[datetime, None], statistic_ids: Union[
|
98
|
-
def statistics_during_period(hass: HomeAssistant, start_time: datetime, end_time: Union[datetime, None], statistic_ids: Union[
|
99
|
+
def _statistics_during_period_with_session(hass: HomeAssistant, session: Session, start_time: datetime, end_time: Union[datetime, None], statistic_ids: Union[set[str], None], period: Literal['5minute', 'day', 'hour', 'week', 'month'], units: Union[dict[str, str], None], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
100
|
+
def statistics_during_period(hass: HomeAssistant, start_time: datetime, end_time: Union[datetime, None], statistic_ids: Union[set[str], None], period: Literal['5minute', 'day', 'hour', 'week', 'month'], units: Union[dict[str, str], None], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
99
101
|
def _get_last_statistics_stmt(metadata_id: int, number_of_stats: int) -> StatementLambdaElement: ...
|
100
102
|
def _get_last_statistics_short_term_stmt(metadata_id: int, number_of_stats: int) -> StatementLambdaElement: ...
|
101
|
-
def _get_last_statistics(hass: HomeAssistant, number_of_stats: int, statistic_id: str, convert_units: bool, table: type[StatisticsBase], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[
|
102
|
-
def get_last_statistics(hass: HomeAssistant, number_of_stats: int, statistic_id: str, convert_units: bool, types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[
|
103
|
-
def get_last_short_term_statistics(hass: HomeAssistant, number_of_stats: int, statistic_id: str, convert_units: bool, types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[
|
103
|
+
def _get_last_statistics(hass: HomeAssistant, number_of_stats: int, statistic_id: str, convert_units: bool, table: type[StatisticsBase], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
104
|
+
def get_last_statistics(hass: HomeAssistant, number_of_stats: int, statistic_id: str, convert_units: bool, types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
105
|
+
def get_last_short_term_statistics(hass: HomeAssistant, number_of_stats: int, statistic_id: str, convert_units: bool, types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
104
106
|
def _latest_short_term_statistics_stmt(metadata_ids: list[int]) -> StatementLambdaElement: ...
|
105
|
-
def get_latest_short_term_statistics(hass: HomeAssistant, statistic_ids:
|
107
|
+
def get_latest_short_term_statistics(hass: HomeAssistant, statistic_ids: set[str], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']], metadata: Union[dict[str, tuple[int, StatisticMetaData]], None] = ...) -> dict[str, list[StatisticsRow]]: ...
|
106
108
|
def _generate_statistics_at_time_stmt(columns: Select, table: type[StatisticsBase], metadata_ids: set[int], start_time_ts: float) -> StatementLambdaElement: ...
|
107
109
|
def _statistics_at_time(session: Session, metadata_ids: set[int], table: type[StatisticsBase], start_time: datetime, types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> Union[Sequence[Row], None]: ...
|
108
|
-
def _sorted_statistics_to_dict(hass: HomeAssistant, session: Session, stats: Sequence[Row[Any]], statistic_ids: Union[
|
110
|
+
def _sorted_statistics_to_dict(hass: HomeAssistant, session: Session, stats: Sequence[Row[Any]], statistic_ids: Union[set[str], None], _metadata: dict[str, tuple[int, StatisticMetaData]], convert_units: bool, table: type[StatisticsBase], start_time: Union[datetime, None], units: Union[dict[str, str], None], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> dict[str, list[StatisticsRow]]: ...
|
109
111
|
def validate_statistics(hass: HomeAssistant) -> dict[str, list[ValidationIssue]]: ...
|
110
112
|
def _statistics_exists(session: Session, table: type[StatisticsBase], metadata_id: int, start: datetime) -> Union[int, None]: ...
|
111
113
|
def _async_import_statistics(hass: HomeAssistant, metadata: StatisticMetaData, statistics: Iterable[StatisticData]) -> None: ...
|
112
114
|
def async_import_statistics(hass: HomeAssistant, metadata: StatisticMetaData, statistics: Iterable[StatisticData]) -> None: ...
|
113
115
|
def async_add_external_statistics(hass: HomeAssistant, metadata: StatisticMetaData, statistics: Iterable[StatisticData]) -> None: ...
|
114
116
|
def _filter_unique_constraint_integrity_error(instance: Recorder) -> Callable[[Exception], bool]: ...
|
115
|
-
def _import_statistics_with_session(session: Session, metadata: StatisticMetaData, statistics: Iterable[StatisticData], table: type[StatisticsBase]) -> bool: ...
|
117
|
+
def _import_statistics_with_session(instance: Recorder, session: Session, metadata: StatisticMetaData, statistics: Iterable[StatisticData], table: type[StatisticsBase]) -> bool: ...
|
116
118
|
def import_statistics(instance: Recorder, metadata: StatisticMetaData, statistics: Iterable[StatisticData], table: type[StatisticsBase]) -> bool: ...
|
117
119
|
def adjust_statistics(instance: Recorder, statistic_id: str, start_time: datetime, sum_adjustment: float, adjustment_unit: str) -> bool: ...
|
118
120
|
def _change_statistics_unit_for_table(session: Session, table: type[StatisticsBase], metadata_id: int, convert: Callable[[Union[float, None]], Union[float, None]]) -> None: ...
|
119
121
|
def change_statistics_unit(instance: Recorder, statistic_id: str, new_unit: str, old_unit: str) -> None: ...
|
120
122
|
def async_change_statistics_unit(hass: HomeAssistant, statistic_id: str, *, new_unit_of_measurement: str, old_unit_of_measurement: str) -> None: ...
|
121
|
-
def _validate_db_schema_utf8(instance: Recorder, session_maker: Callable[[], Session]) -> set[str]: ...
|
122
|
-
def _validate_db_schema(hass: HomeAssistant, instance: Recorder, session_maker: Callable[[], Session]) -> set[str]: ...
|
123
|
-
def validate_db_schema(hass: HomeAssistant, instance: Recorder, session_maker: Callable[[], Session]) -> set[str]: ...
|
124
|
-
def correct_db_schema(instance: Recorder, engine: Engine, session_maker: Callable[[], Session], schema_errors: set[str]) -> None: ...
|
125
123
|
def cleanup_statistics_timestamp_migration(instance: Recorder) -> bool: ...
|
@@ -0,0 +1,20 @@
|
|
1
|
+
from ..core import Recorder as Recorder
|
2
|
+
from _typeshed import Incomplete
|
3
|
+
from typing import TypeVar
|
4
|
+
|
5
|
+
_DataT = TypeVar('_DataT')
|
6
|
+
|
7
|
+
class BaseTableManager:
|
8
|
+
active: bool
|
9
|
+
recorder: Incomplete
|
10
|
+
_pending: Incomplete
|
11
|
+
_id_map: Incomplete
|
12
|
+
def __init__(self, recorder: Recorder) -> None: ...
|
13
|
+
def get_from_cache(self, data: str) -> Union[int, None]: ...
|
14
|
+
def get_pending(self, shared_data: str) -> Union[_DataT, None]: ...
|
15
|
+
def reset(self) -> None: ...
|
16
|
+
|
17
|
+
class BaseLRUTableManager(BaseTableManager[_DataT]):
|
18
|
+
_id_map: Incomplete
|
19
|
+
def __init__(self, recorder: Recorder, lru_size: int) -> None: ...
|
20
|
+
def adjust_lru_size(self, new_size: int) -> None: ...
|
@@ -0,0 +1,26 @@
|
|
1
|
+
from . import BaseLRUTableManager as BaseLRUTableManager
|
2
|
+
from ..const import SQLITE_MAX_BIND_VARS as SQLITE_MAX_BIND_VARS
|
3
|
+
from ..core import Recorder as Recorder
|
4
|
+
from ..db_schema import EventData as EventData
|
5
|
+
from ..queries import get_shared_event_datas as get_shared_event_datas
|
6
|
+
from ..util import chunked as chunked, execute_stmt_lambda_element as execute_stmt_lambda_element
|
7
|
+
from _typeshed import Incomplete
|
8
|
+
from collections.abc import Iterable
|
9
|
+
from homeassistant.core import Event as Event
|
10
|
+
from homeassistant.util.json import JSON_ENCODE_EXCEPTIONS as JSON_ENCODE_EXCEPTIONS
|
11
|
+
from sqlalchemy.orm.session import Session as Session
|
12
|
+
|
13
|
+
CACHE_SIZE: int
|
14
|
+
_LOGGER: Incomplete
|
15
|
+
|
16
|
+
class EventDataManager(BaseLRUTableManager[EventData]):
|
17
|
+
active: bool
|
18
|
+
def __init__(self, recorder: Recorder) -> None: ...
|
19
|
+
def serialize_from_event(self, event: Event) -> Union[bytes, None]: ...
|
20
|
+
def load(self, events: list[Event], session: Session) -> None: ...
|
21
|
+
def get(self, shared_data: str, data_hash: int, session: Session) -> Union[int, None]: ...
|
22
|
+
def get_many(self, shared_data_data_hashs: Iterable[tuple[str, int]], session: Session) -> dict[str, Union[int, None]]: ...
|
23
|
+
def _load_from_hashes(self, hashes: Iterable[int], session: Session) -> dict[str, Union[int, None]]: ...
|
24
|
+
def add_pending(self, db_event_data: EventData) -> None: ...
|
25
|
+
def post_commit_pending(self) -> None: ...
|
26
|
+
def evict_purged(self, data_ids: set[int]) -> None: ...
|
@@ -0,0 +1,20 @@
|
|
1
|
+
from . import BaseLRUTableManager as BaseLRUTableManager
|
2
|
+
from ..const import SQLITE_MAX_BIND_VARS as SQLITE_MAX_BIND_VARS
|
3
|
+
from ..core import Recorder as Recorder
|
4
|
+
from ..db_schema import EventTypes as EventTypes
|
5
|
+
from ..queries import find_event_type_ids as find_event_type_ids
|
6
|
+
from ..util import chunked as chunked, execute_stmt_lambda_element as execute_stmt_lambda_element
|
7
|
+
from collections.abc import Iterable
|
8
|
+
from homeassistant.core import Event as Event
|
9
|
+
from sqlalchemy.orm.session import Session as Session
|
10
|
+
|
11
|
+
CACHE_SIZE: int
|
12
|
+
|
13
|
+
class EventTypeManager(BaseLRUTableManager[EventTypes]):
|
14
|
+
def __init__(self, recorder: Recorder) -> None: ...
|
15
|
+
def load(self, events: list[Event], session: Session) -> None: ...
|
16
|
+
def get(self, event_type: str, session: Session) -> Union[int, None]: ...
|
17
|
+
def get_many(self, event_types: Iterable[str], session: Session) -> dict[str, Union[int, None]]: ...
|
18
|
+
def add_pending(self, db_event_type: EventTypes) -> None: ...
|
19
|
+
def post_commit_pending(self) -> None: ...
|
20
|
+
def evict_purged(self, event_types: Iterable[str]) -> None: ...
|
homeassistant-stubs/components/recorder/{run_history.pyi → table_managers/recorder_runs.pyi}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
|
-
from
|
2
|
-
from
|
1
|
+
from ..db_schema import RecorderRuns as RecorderRuns
|
2
|
+
from ..models import process_timestamp as process_timestamp
|
3
3
|
from _typeshed import Incomplete
|
4
4
|
from datetime import datetime
|
5
5
|
from sqlalchemy.orm.session import Session as Session
|
@@ -11,7 +11,7 @@ class _RecorderRunsHistory:
|
|
11
11
|
runs_by_timestamp: dict[int, RecorderRuns]
|
12
12
|
def __init__(self, run_timestamps, runs_by_timestamp) -> None: ...
|
13
13
|
|
14
|
-
class
|
14
|
+
class RecorderRunsManager:
|
15
15
|
_recording_start: Incomplete
|
16
16
|
_current_run_info: Incomplete
|
17
17
|
_run_history: Incomplete
|
@@ -0,0 +1,29 @@
|
|
1
|
+
from . import BaseLRUTableManager as BaseLRUTableManager
|
2
|
+
from ..const import SQLITE_MAX_BIND_VARS as SQLITE_MAX_BIND_VARS
|
3
|
+
from ..core import Recorder as Recorder
|
4
|
+
from ..db_schema import StateAttributes as StateAttributes
|
5
|
+
from ..queries import get_shared_attributes as get_shared_attributes
|
6
|
+
from ..util import chunked as chunked, execute_stmt_lambda_element as execute_stmt_lambda_element
|
7
|
+
from _typeshed import Incomplete
|
8
|
+
from collections.abc import Iterable
|
9
|
+
from homeassistant.core import Event as Event
|
10
|
+
from homeassistant.helpers.entity import entity_sources as entity_sources
|
11
|
+
from homeassistant.util.json import JSON_ENCODE_EXCEPTIONS as JSON_ENCODE_EXCEPTIONS
|
12
|
+
from sqlalchemy.orm.session import Session as Session
|
13
|
+
|
14
|
+
CACHE_SIZE: int
|
15
|
+
_LOGGER: Incomplete
|
16
|
+
|
17
|
+
class StateAttributesManager(BaseLRUTableManager[StateAttributes]):
|
18
|
+
active: bool
|
19
|
+
_exclude_attributes_by_domain: Incomplete
|
20
|
+
_entity_sources: Incomplete
|
21
|
+
def __init__(self, recorder: Recorder, exclude_attributes_by_domain: dict[str, set[str]]) -> None: ...
|
22
|
+
def serialize_from_event(self, event: Event) -> Union[bytes, None]: ...
|
23
|
+
def load(self, events: list[Event], session: Session) -> None: ...
|
24
|
+
def get(self, shared_attr: str, data_hash: int, session: Session) -> Union[int, None]: ...
|
25
|
+
def get_many(self, shared_attrs_data_hashes: Iterable[tuple[str, int]], session: Session) -> dict[str, Union[int, None]]: ...
|
26
|
+
def _load_from_hashes(self, hashes: Iterable[int], session: Session) -> dict[str, Union[int, None]]: ...
|
27
|
+
def add_pending(self, db_state_attributes: StateAttributes) -> None: ...
|
28
|
+
def post_commit_pending(self) -> None: ...
|
29
|
+
def evict_purged(self, attributes_ids: set[int]) -> None: ...
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from ..db_schema import States as States
|
2
|
+
from _typeshed import Incomplete
|
3
|
+
|
4
|
+
class StatesManager:
|
5
|
+
_pending: Incomplete
|
6
|
+
_last_committed_id: Incomplete
|
7
|
+
def __init__(self) -> None: ...
|
8
|
+
def pop_pending(self, entity_id: str) -> Union[States, None]: ...
|
9
|
+
def pop_committed(self, entity_id: str) -> Union[int, None]: ...
|
10
|
+
def add_pending(self, entity_id: str, state: States) -> None: ...
|
11
|
+
def post_commit_pending(self) -> None: ...
|
12
|
+
def reset(self) -> None: ...
|
13
|
+
def evict_purged_state_ids(self, purged_state_ids: set[int]) -> None: ...
|
14
|
+
def evict_purged_entity_ids(self, purged_entity_ids: set[str]) -> None: ...
|
@@ -0,0 +1,23 @@
|
|
1
|
+
from . import BaseLRUTableManager as BaseLRUTableManager
|
2
|
+
from ..const import SQLITE_MAX_BIND_VARS as SQLITE_MAX_BIND_VARS
|
3
|
+
from ..core import Recorder as Recorder
|
4
|
+
from ..db_schema import StatesMeta as StatesMeta
|
5
|
+
from ..queries import find_all_states_metadata_ids as find_all_states_metadata_ids, find_states_metadata_ids as find_states_metadata_ids
|
6
|
+
from ..util import chunked as chunked, execute_stmt_lambda_element as execute_stmt_lambda_element
|
7
|
+
from collections.abc import Iterable
|
8
|
+
from homeassistant.core import Event as Event
|
9
|
+
from sqlalchemy.orm.session import Session as Session
|
10
|
+
|
11
|
+
CACHE_SIZE: int
|
12
|
+
|
13
|
+
class StatesMetaManager(BaseLRUTableManager[StatesMeta]):
|
14
|
+
_did_first_load: bool
|
15
|
+
def __init__(self, recorder: Recorder) -> None: ...
|
16
|
+
def load(self, events: list[Event], session: Session) -> None: ...
|
17
|
+
def get(self, entity_id: str, session: Session, from_recorder: bool) -> Union[int, None]: ...
|
18
|
+
def get_metadata_id_to_entity_id(self, session: Session) -> dict[int, str]: ...
|
19
|
+
def get_many(self, entity_ids: Iterable[str], session: Session, from_recorder: bool) -> dict[str, Union[int, None]]: ...
|
20
|
+
def add_pending(self, db_states_meta: StatesMeta) -> None: ...
|
21
|
+
def post_commit_pending(self) -> None: ...
|
22
|
+
def evict_purged(self, entity_ids: Iterable[str]) -> None: ...
|
23
|
+
def update_metadata(self, session: Session, entity_id: str, new_entity_id: str) -> bool: ...
|
@@ -0,0 +1,35 @@
|
|
1
|
+
from ..core import Recorder as Recorder
|
2
|
+
from ..db_schema import StatisticsMeta as StatisticsMeta
|
3
|
+
from ..models import StatisticMetaData as StatisticMetaData
|
4
|
+
from ..util import execute_stmt_lambda_element as execute_stmt_lambda_element
|
5
|
+
from _typeshed import Incomplete
|
6
|
+
from sqlalchemy.orm.session import Session as Session
|
7
|
+
from sqlalchemy.sql.lambdas import StatementLambdaElement as StatementLambdaElement
|
8
|
+
from typing import Literal
|
9
|
+
|
10
|
+
CACHE_SIZE: int
|
11
|
+
_LOGGER: Incomplete
|
12
|
+
QUERY_STATISTIC_META: Incomplete
|
13
|
+
|
14
|
+
def _generate_get_metadata_stmt(statistic_ids: Union[set[str], None] = ..., statistic_type: Union[Literal['mean'], Literal['sum'], None] = ..., statistic_source: Union[str, None] = ...) -> StatementLambdaElement: ...
|
15
|
+
def _statistics_meta_to_id_statistics_metadata(meta: StatisticsMeta) -> tuple[int, StatisticMetaData]: ...
|
16
|
+
|
17
|
+
class StatisticsMetaManager:
|
18
|
+
recorder: Incomplete
|
19
|
+
_stat_id_to_id_meta: Incomplete
|
20
|
+
def __init__(self, recorder: Recorder) -> None: ...
|
21
|
+
def _clear_cache(self, statistic_ids: list[str]) -> None: ...
|
22
|
+
def _get_from_database(self, session: Session, statistic_ids: Union[set[str], None] = ..., statistic_type: Union[Literal['mean'], Literal['sum'], None] = ..., statistic_source: Union[str, None] = ...) -> dict[str, tuple[int, StatisticMetaData]]: ...
|
23
|
+
def _assert_in_recorder_thread(self) -> None: ...
|
24
|
+
def _add_metadata(self, session: Session, statistic_id: str, new_metadata: StatisticMetaData) -> int: ...
|
25
|
+
def _update_metadata(self, session: Session, statistic_id: str, new_metadata: StatisticMetaData, old_metadata_dict: dict[str, tuple[int, StatisticMetaData]]) -> tuple[Union[str, None], int]: ...
|
26
|
+
def load(self, session: Session) -> None: ...
|
27
|
+
def get(self, session: Session, statistic_id: str) -> Union[tuple[int, StatisticMetaData], None]: ...
|
28
|
+
def get_many(self, session: Session, statistic_ids: Union[set[str], None] = ..., statistic_type: Union[Literal['mean'], Literal['sum'], None] = ..., statistic_source: Union[str, None] = ...) -> dict[str, tuple[int, StatisticMetaData]]: ...
|
29
|
+
def get_from_cache_threadsafe(self, statistic_ids: set[str]) -> dict[str, tuple[int, StatisticMetaData]]: ...
|
30
|
+
def update_or_add(self, session: Session, new_metadata: StatisticMetaData, old_metadata_dict: dict[str, tuple[int, StatisticMetaData]]) -> tuple[Union[str, None], int]: ...
|
31
|
+
def update_unit_of_measurement(self, session: Session, statistic_id: str, new_unit: Union[str, None]) -> None: ...
|
32
|
+
def update_statistic_id(self, session: Session, source: str, old_statistic_id: str, new_statistic_id: str) -> None: ...
|
33
|
+
def delete(self, session: Session, statistic_ids: list[str]) -> None: ...
|
34
|
+
def reset(self) -> None: ...
|
35
|
+
def adjust_lru_size(self, new_size: int) -> None: ...
|
@@ -1,19 +1,22 @@
|
|
1
1
|
import abc
|
2
2
|
import asyncio
|
3
3
|
import threading
|
4
|
-
from . import purge as purge, statistics as statistics
|
5
|
-
from .const import DOMAIN as DOMAIN
|
4
|
+
from . import entity_registry as entity_registry, purge as purge, statistics as statistics
|
5
|
+
from .const import DOMAIN as DOMAIN
|
6
6
|
from .core import Recorder as Recorder
|
7
7
|
from .db_schema import Statistics as Statistics, StatisticsShortTerm as StatisticsShortTerm
|
8
8
|
from .models import StatisticData as StatisticData, StatisticMetaData as StatisticMetaData
|
9
9
|
from .util import periodic_db_cleanups as periodic_db_cleanups
|
10
|
+
from _typeshed import Incomplete
|
10
11
|
from collections.abc import Callable as Callable, Iterable
|
11
12
|
from datetime import datetime
|
12
13
|
from homeassistant.core import Event as Event
|
13
14
|
from homeassistant.helpers.typing import UndefinedType as UndefinedType
|
14
15
|
from typing import Any
|
15
16
|
|
16
|
-
|
17
|
+
_LOGGER: Incomplete
|
18
|
+
|
19
|
+
class RecorderTask(metaclass=abc.ABCMeta):
|
17
20
|
commit_before: bool
|
18
21
|
@abc.abstractmethod
|
19
22
|
def run(self, instance: Recorder) -> None: ...
|
@@ -37,6 +40,12 @@ class UpdateStatisticsMetadataTask(RecorderTask):
|
|
37
40
|
def run(self, instance: Recorder) -> None: ...
|
38
41
|
def __init__(self, statistic_id, new_statistic_id, new_unit_of_measurement) -> None: ...
|
39
42
|
|
43
|
+
class UpdateStatesMetadataTask(RecorderTask):
|
44
|
+
entity_id: str
|
45
|
+
new_entity_id: str
|
46
|
+
def run(self, instance: Recorder) -> None: ...
|
47
|
+
def __init__(self, entity_id, new_entity_id) -> None: ...
|
48
|
+
|
40
49
|
class PurgeTask(RecorderTask):
|
41
50
|
purge_before: datetime
|
42
51
|
repack: bool
|
@@ -46,8 +55,9 @@ class PurgeTask(RecorderTask):
|
|
46
55
|
|
47
56
|
class PurgeEntitiesTask(RecorderTask):
|
48
57
|
entity_filter: Callable[[str], bool]
|
58
|
+
purge_before: datetime
|
49
59
|
def run(self, instance: Recorder) -> None: ...
|
50
|
-
def __init__(self, entity_filter) -> None: ...
|
60
|
+
def __init__(self, entity_filter, purge_before) -> None: ...
|
51
61
|
|
52
62
|
class PerodicCleanupTask(RecorderTask):
|
53
63
|
def run(self, instance: Recorder) -> None: ...
|
@@ -58,6 +68,9 @@ class StatisticsTask(RecorderTask):
|
|
58
68
|
def run(self, instance: Recorder) -> None: ...
|
59
69
|
def __init__(self, start, fire_events) -> None: ...
|
60
70
|
|
71
|
+
class CompileMissingStatisticsTask(RecorderTask):
|
72
|
+
def run(self, instance: Recorder) -> None: ...
|
73
|
+
|
61
74
|
class ImportStatisticsTask(RecorderTask):
|
62
75
|
metadata: StatisticMetaData
|
63
76
|
statistics: Iterable[StatisticData]
|
@@ -126,3 +139,25 @@ class StatisticsTimestampMigrationCleanupTask(RecorderTask):
|
|
126
139
|
class AdjustLRUSizeTask(RecorderTask):
|
127
140
|
commit_before: bool
|
128
141
|
def run(self, instance: Recorder) -> None: ...
|
142
|
+
|
143
|
+
class StatesContextIDMigrationTask(RecorderTask):
|
144
|
+
commit_before: bool
|
145
|
+
def run(self, instance: Recorder) -> None: ...
|
146
|
+
|
147
|
+
class EventsContextIDMigrationTask(RecorderTask):
|
148
|
+
commit_before: bool
|
149
|
+
def run(self, instance: Recorder) -> None: ...
|
150
|
+
|
151
|
+
class EventTypeIDMigrationTask(RecorderTask):
|
152
|
+
commit_before: bool
|
153
|
+
def run(self, instance: Recorder) -> None: ...
|
154
|
+
|
155
|
+
class EntityIDMigrationTask(RecorderTask):
|
156
|
+
commit_before: bool
|
157
|
+
def run(self, instance: Recorder) -> None: ...
|
158
|
+
|
159
|
+
class EntityIDPostMigrationTask(RecorderTask):
|
160
|
+
def run(self, instance: Recorder) -> None: ...
|
161
|
+
|
162
|
+
class EventIdMigrationTask(RecorderTask):
|
163
|
+
def run(self, instance: Recorder) -> None: ...
|
@@ -46,7 +46,7 @@ FIRST_POSSIBLE_SUNDAY: int
|
|
46
46
|
SUNDAY_WEEKDAY: int
|
47
47
|
DAYS_IN_WEEK: int
|
48
48
|
|
49
|
-
def session_scope(*, hass: Union[HomeAssistant, None] = ..., session: Union[Session, None] = ..., exception_filter: Union[Callable[[Exception], bool], None] = ...) -> Generator[Session, None, None]: ...
|
49
|
+
def session_scope(*, hass: Union[HomeAssistant, None] = ..., session: Union[Session, None] = ..., exception_filter: Union[Callable[[Exception], bool], None] = ..., read_only: bool = ...) -> Generator[Session, None, None]: ...
|
50
50
|
def execute(qry: Query, to_native: bool = ..., validate_entity_ids: bool = ...) -> list[Row]: ...
|
51
51
|
def execute_stmt_lambda_element(session: Session, stmt: StatementLambdaElement, start_time: Union[datetime, None] = ..., end_time: Union[datetime, None] = ..., yield_per: int = ...) -> Union[Sequence[Row], Result]: ...
|
52
52
|
def validate_or_move_away_sqlite_database(dburl: str) -> bool: ...
|
@@ -88,3 +88,4 @@ PERIOD_SCHEMA: Incomplete
|
|
88
88
|
def resolve_period(period_def: StatisticPeriod) -> tuple[Union[datetime, None], Union[datetime, None]]: ...
|
89
89
|
def take(take_num: int, iterable: Iterable) -> list[Any]: ...
|
90
90
|
def chunked(iterable: Iterable, chunked_num: int) -> Iterable[Any]: ...
|
91
|
+
def get_index_by_name(session: Session, table_name: str, index_name: str) -> Union[str, None]: ...
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import logging
|
2
2
|
from .const import MAX_QUEUE_BACKLOG as MAX_QUEUE_BACKLOG
|
3
3
|
from .models import StatisticPeriod as StatisticPeriod
|
4
|
-
from .statistics import STATISTIC_UNIT_TO_UNIT_CONVERTER as STATISTIC_UNIT_TO_UNIT_CONVERTER, async_add_external_statistics as async_add_external_statistics, async_change_statistics_unit as async_change_statistics_unit, async_import_statistics as async_import_statistics, list_statistic_ids as list_statistic_ids, statistic_during_period as statistic_during_period, statistics_during_period as statistics_during_period, validate_statistics as validate_statistics
|
4
|
+
from .statistics import STATISTIC_UNIT_TO_UNIT_CONVERTER as STATISTIC_UNIT_TO_UNIT_CONVERTER, async_add_external_statistics as async_add_external_statistics, async_change_statistics_unit as async_change_statistics_unit, async_import_statistics as async_import_statistics, async_list_statistic_ids as async_list_statistic_ids, list_statistic_ids as list_statistic_ids, statistic_during_period as statistic_during_period, statistics_during_period as statistics_during_period, validate_statistics as validate_statistics
|
5
5
|
from .util import PERIOD_SCHEMA as PERIOD_SCHEMA, async_migration_in_progress as async_migration_in_progress, async_migration_is_live as async_migration_is_live, get_instance as get_instance, resolve_period as resolve_period
|
6
6
|
from _typeshed import Incomplete
|
7
7
|
from datetime import datetime as dt
|
@@ -19,7 +19,7 @@ UNIT_SCHEMA: Incomplete
|
|
19
19
|
def async_setup(hass: HomeAssistant) -> None: ...
|
20
20
|
def _ws_get_statistic_during_period(hass: HomeAssistant, msg_id: int, start_time: Union[dt, None], end_time: Union[dt, None], statistic_id: str, types: Union[set[Literal['max', 'mean', 'min', 'change']], None], units: dict[str, str]) -> str: ...
|
21
21
|
async def ws_get_statistic_during_period(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]) -> None: ...
|
22
|
-
def _ws_get_statistics_during_period(hass: HomeAssistant, msg_id: int, start_time: dt, end_time: Union[dt, None], statistic_ids: Union[
|
22
|
+
def _ws_get_statistics_during_period(hass: HomeAssistant, msg_id: int, start_time: dt, end_time: Union[dt, None], statistic_ids: Union[set[str], None], period: Literal['5minute', 'day', 'hour', 'week', 'month'], units: dict[str, str], types: set[Literal['last_reset', 'max', 'mean', 'min', 'state', 'sum']]) -> str: ...
|
23
23
|
async def ws_handle_get_statistics_during_period(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict) -> None: ...
|
24
24
|
async def ws_get_statistics_during_period(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]) -> None: ...
|
25
25
|
def _ws_get_list_statistic_ids(hass: HomeAssistant, msg_id: int, statistic_type: Union[Literal['mean'], Literal['sum'], None] = ...) -> str: ...
|
@@ -39,6 +39,7 @@ class RenaultVehicleProxy:
|
|
39
39
|
async def async_initialise(self) -> None: ...
|
40
40
|
async def set_charge_mode(self, charge_mode: str) -> models.KamereonVehicleChargeModeActionData: ...
|
41
41
|
async def set_charge_start(self) -> models.KamereonVehicleChargingStartActionData: ...
|
42
|
+
async def set_charge_stop(self) -> models.KamereonVehicleChargingStartActionData: ...
|
42
43
|
async def set_ac_stop(self) -> models.KamereonVehicleHvacStartActionData: ...
|
43
44
|
async def set_ac_start(self, temperature: float, when: Union[datetime, None] = ...) -> models.KamereonVehicleHvacStartActionData: ...
|
44
45
|
async def get_charging_settings(self) -> models.KamereonVehicleChargingSettingsData: ...
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from .const import COORDINATOR as COORDINATOR, DOMAIN as DOMAIN, PLATFORM_IDX as PLATFORM_IDX, REST as REST, REST_DATA as REST_DATA, REST_IDX as REST_IDX
|
1
|
+
from .const import CONF_ENCODING as CONF_ENCODING, COORDINATOR as COORDINATOR, DOMAIN as DOMAIN, PLATFORM_IDX as PLATFORM_IDX, REST as REST, REST_DATA as REST_DATA, REST_IDX as REST_IDX
|
2
2
|
from .data import RestData as RestData
|
3
3
|
from .schema import CONFIG_SCHEMA as CONFIG_SCHEMA, RESOURCE_SCHEMA as RESOURCE_SCHEMA
|
4
4
|
from _typeshed import Incomplete
|
@@ -2,7 +2,7 @@ import httpx
|
|
2
2
|
from _typeshed import Incomplete
|
3
3
|
from homeassistant.core import HomeAssistant as HomeAssistant
|
4
4
|
from homeassistant.helpers import template as template
|
5
|
-
from homeassistant.helpers.httpx_client import
|
5
|
+
from homeassistant.helpers.httpx_client import create_async_httpx_client as create_async_httpx_client
|
6
6
|
|
7
7
|
DEFAULT_TIMEOUT: int
|
8
8
|
_LOGGER: Incomplete
|
@@ -11,6 +11,7 @@ class RestData:
|
|
11
11
|
_hass: Incomplete
|
12
12
|
_method: Incomplete
|
13
13
|
_resource: Incomplete
|
14
|
+
_encoding: Incomplete
|
14
15
|
_auth: Incomplete
|
15
16
|
_headers: Incomplete
|
16
17
|
_params: Incomplete
|
@@ -21,6 +22,6 @@ class RestData:
|
|
21
22
|
data: Incomplete
|
22
23
|
last_exception: Incomplete
|
23
24
|
headers: Incomplete
|
24
|
-
def __init__(self, hass: HomeAssistant, method: str, resource: str, auth: Union[httpx.DigestAuth, tuple[str, str], None], headers: Union[dict[str, str], None], params: Union[dict[str, str], None], data: Union[str, None], verify_ssl: bool, timeout: int = ...) -> None: ...
|
25
|
+
def __init__(self, hass: HomeAssistant, method: str, resource: str, encoding: str, auth: Union[httpx.DigestAuth, tuple[str, str], None], headers: Union[dict[str, str], None], params: Union[dict[str, str], None], data: Union[str, None], verify_ssl: bool, timeout: int = ...) -> None: ...
|
25
26
|
def set_url(self, url: str) -> None: ...
|
26
27
|
async def async_update(self, log_errors: bool = ...) -> None: ...
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from .const import CONF_JSON_ATTRS as CONF_JSON_ATTRS, CONF_JSON_ATTRS_PATH as CONF_JSON_ATTRS_PATH, DEFAULT_FORCE_UPDATE as DEFAULT_FORCE_UPDATE, DEFAULT_METHOD as DEFAULT_METHOD, DEFAULT_VERIFY_SSL as DEFAULT_VERIFY_SSL, DOMAIN as DOMAIN, METHODS as METHODS
|
1
|
+
from .const import CONF_ENCODING as CONF_ENCODING, CONF_JSON_ATTRS as CONF_JSON_ATTRS, CONF_JSON_ATTRS_PATH as CONF_JSON_ATTRS_PATH, DEFAULT_ENCODING as DEFAULT_ENCODING, DEFAULT_FORCE_UPDATE as DEFAULT_FORCE_UPDATE, DEFAULT_METHOD as DEFAULT_METHOD, DEFAULT_VERIFY_SSL as DEFAULT_VERIFY_SSL, DOMAIN as DOMAIN, METHODS as METHODS
|
2
2
|
from .data import DEFAULT_TIMEOUT as DEFAULT_TIMEOUT
|
3
3
|
from _typeshed import Incomplete
|
4
4
|
from homeassistant.const import CONF_AUTHENTICATION as CONF_AUTHENTICATION, CONF_DEVICE_CLASS as CONF_DEVICE_CLASS, CONF_FORCE_UPDATE as CONF_FORCE_UPDATE, CONF_HEADERS as CONF_HEADERS, CONF_METHOD as CONF_METHOD, CONF_PARAMS as CONF_PARAMS, CONF_PASSWORD as CONF_PASSWORD, CONF_PAYLOAD as CONF_PAYLOAD, CONF_RESOURCE as CONF_RESOURCE, CONF_RESOURCE_TEMPLATE as CONF_RESOURCE_TEMPLATE, CONF_SCAN_INTERVAL as CONF_SCAN_INTERVAL, CONF_TIMEOUT as CONF_TIMEOUT, CONF_USERNAME as CONF_USERNAME, CONF_VALUE_TEMPLATE as CONF_VALUE_TEMPLATE, CONF_VERIFY_SSL as CONF_VERIFY_SSL, HTTP_BASIC_AUTHENTICATION as HTTP_BASIC_AUTHENTICATION, HTTP_DIGEST_AUTHENTICATION as HTTP_DIGEST_AUTHENTICATION
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import datetime
|
2
|
+
from .const import DOMAIN as DOMAIN
|
3
|
+
from .coordinator import RidwellDataUpdateCoordinator as RidwellDataUpdateCoordinator
|
4
|
+
from .entity import RidwellEntity as RidwellEntity
|
5
|
+
from _typeshed import Incomplete
|
6
|
+
from aioridwell.model import RidwellAccount as RidwellAccount, RidwellPickupEvent as RidwellPickupEvent
|
7
|
+
from homeassistant.components.calendar import CalendarEntity as CalendarEntity, CalendarEvent as CalendarEvent
|
8
|
+
from homeassistant.config_entries import ConfigEntry as ConfigEntry
|
9
|
+
from homeassistant.core import HomeAssistant as HomeAssistant, callback as callback
|
10
|
+
from homeassistant.helpers.entity_platform import AddEntitiesCallback as AddEntitiesCallback
|
11
|
+
|
12
|
+
def async_get_calendar_event_from_pickup_event(pickup_event: RidwellPickupEvent) -> CalendarEvent: ...
|
13
|
+
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback) -> None: ...
|
14
|
+
|
15
|
+
class RidwellCalendar(RidwellEntity, CalendarEntity):
|
16
|
+
_attr_icon: str
|
17
|
+
_attr_unique_id: Incomplete
|
18
|
+
_event: Incomplete
|
19
|
+
def __init__(self, coordinator: RidwellDataUpdateCoordinator, account: RidwellAccount) -> None: ...
|
20
|
+
@property
|
21
|
+
def event(self) -> Union[CalendarEvent, None]: ...
|
22
|
+
async def async_get_events(self, hass: HomeAssistant, start_date: datetime.datetime, end_date: datetime.datetime) -> list[CalendarEvent]: ...
|
@@ -10,11 +10,11 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator as Da
|
|
10
10
|
|
11
11
|
UPDATE_INTERVAL: Incomplete
|
12
12
|
|
13
|
-
class RidwellDataUpdateCoordinator(DataUpdateCoordinator[dict[str, RidwellPickupEvent]]):
|
13
|
+
class RidwellDataUpdateCoordinator(DataUpdateCoordinator[dict[str, list[RidwellPickupEvent]]]):
|
14
14
|
config_entry: ConfigEntry
|
15
15
|
accounts: Incomplete
|
16
16
|
dashboard_url: str
|
17
17
|
user_id: str
|
18
18
|
def __init__(self, hass: HomeAssistant, *, name: str) -> None: ...
|
19
|
-
async def _async_update_data(self) -> dict[str, RidwellPickupEvent]: ...
|
19
|
+
async def _async_update_data(self) -> dict[str, list[RidwellPickupEvent]]: ...
|
20
20
|
async def async_initialize(self) -> None: ...
|
@@ -3,15 +3,13 @@ from .coordinator import RidwellDataUpdateCoordinator as RidwellDataUpdateCoordi
|
|
3
3
|
from _typeshed import Incomplete
|
4
4
|
from aioridwell.model import RidwellAccount as RidwellAccount, RidwellPickupEvent as RidwellPickupEvent
|
5
5
|
from homeassistant.helpers.device_registry import DeviceEntryType as DeviceEntryType
|
6
|
-
from homeassistant.helpers.entity import DeviceInfo as DeviceInfo
|
6
|
+
from homeassistant.helpers.entity import DeviceInfo as DeviceInfo
|
7
7
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity as CoordinatorEntity
|
8
8
|
|
9
9
|
class RidwellEntity(CoordinatorEntity[RidwellDataUpdateCoordinator]):
|
10
10
|
_attr_has_entity_name: bool
|
11
11
|
_account: Incomplete
|
12
12
|
_attr_device_info: Incomplete
|
13
|
-
|
14
|
-
entity_description: Incomplete
|
15
|
-
def __init__(self, coordinator: RidwellDataUpdateCoordinator, account: RidwellAccount, description: EntityDescription) -> None: ...
|
13
|
+
def __init__(self, coordinator: RidwellDataUpdateCoordinator, account: RidwellAccount) -> None: ...
|
16
14
|
@property
|
17
15
|
def next_pickup_event(self) -> RidwellPickupEvent: ...
|
@@ -20,7 +20,8 @@ SENSOR_DESCRIPTION: Incomplete
|
|
20
20
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback) -> None: ...
|
21
21
|
|
22
22
|
class RidwellSensor(RidwellEntity, SensorEntity):
|
23
|
-
|
23
|
+
_attr_unique_id: Incomplete
|
24
|
+
entity_description: Incomplete
|
24
25
|
def __init__(self, coordinator: RidwellDataUpdateCoordinator, account: RidwellAccount, description: SensorEntityDescription) -> None: ...
|
25
26
|
@property
|
26
27
|
def extra_state_attributes(self) -> Mapping[str, Any]: ...
|