Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
home_io_control.cover Namespace Reference

Functions

 _declared_features (config)
 _default_device_class (config)
 _require_travel_speed_kind (config)
 silent_switch_name (config)
 travel_speed_select_name (config)
 rain_sensor_name (config)
 sun_level_sensor_name (config)
 battery_level_sensor_name (config)
 battery_low_sensor_name (config)
 battery_sensor_name (config)
 _inject_companion_ids (config)
 _silent_replacement (config)
 to_code (config)
 _create_reading_sensor (config, parent, cls, id_key, name, **schema_kwargs)
 _create_battery_sensors (config, parent)

Variables

list DEPENDENCIES = ["home_io_control"]
str CONF_SILENT = "silent"
str CONF_SILENT_SWITCH_ID = "_silent_switch_id"
str CONF_TRAVEL_SPEED = "travel_speed"
str CONF_TRAVEL_SPEED_SELECT_ID = "_travel_speed_select_id"
str CONF_OPTIMISTIC_STATE = "optimistic_state"
str CONF_RAIN_SENSOR_POLL_INTERVAL = "rain_sensor_poll_interval"
str CONF_RAIN_SENSOR_ID = "_rain_sensor_id"
str CONF_SUN_LEVEL_POLL_INTERVAL = "sun_level_poll_interval"
str CONF_SUN_LEVEL_SENSOR_ID = "_sun_level_sensor_id"
str CONF_BATTERY_LEVEL_POLL_INTERVAL = "battery_level_poll_interval"
str CONF_BATTERY_LEVEL_SENSOR_ID = "_battery_level_sensor_id"
str CONF_STATUS_REFRESH_INTERVAL = "status_refresh_interval"
str CONF_BATTERY = "battery"
str CONF_BATTERY_LOW_SENSOR_ID = "_battery_low_sensor_id"
str CONF_BATTERY_SENSOR_ID = "_battery_sensor_id"
str CONF_FAVORITE_BUTTON_ID = "_favorite_button_id"
str CONF_VENT_BUTTON_ID = "_vent_button_id"
str CONF_PARTIAL_BUTTON_ID = "_partial_button_id"
str CONF_PEDESTRIAN_BUTTON_ID = "_pedestrian_button_id"
 IOHomeCover = home_io_control_ns.class_("IOHomeCover", cover.Cover, cg.Component)
 IOHomeCoverSilentSwitch
 IOHomeCoverTravelSpeedSelect
 TravelSpeed = home_io_control_ns.enum("TravelSpeed", is_class=True)
dict TRAVEL_SPEEDS
tuple TRAVEL_SPEED_EXCLUSIVE_MESSAGE
 IOHomeRainBinarySensor
 IOHomeSunLevelSensor
 IOHomeBatteryLevelSensor
 IOHomeBatteryLowBinarySensor
 IOHomeBatteryTextSensor
 IOHomeCoverCommandButton
 CoverCommand = home_io_control_ns.enum("CoverCommand", is_class=True)
dict NAMED_POSITION_BUTTONS
 CONFIG_SCHEMA

Function Documentation

◆ _create_battery_sensors()

_create_battery_sensors ( config,
parent )
protected
Create the two `battery: true` companions.

Battery Low is the enabled one: a `device_class: battery` binary sensor is Home Assistant's own
low-battery signal. Battery (full/normal/low) is diagnostic and disabled by default; ESPHome
text sensors carry no battery device class, so nothing generic reads it.

Definition at line 511 of file cover.py.

Here is the call graph for this function:

◆ _create_reading_sensor()

_create_reading_sensor ( config,
parent,
cls,
id_key,
name,
** schema_kwargs )
protected
Create one polled reading sensor (sun level, battery level) bound to the cover's device.

Definition at line 489 of file cover.py.

◆ _declared_features()

_declared_features ( config)
protected
The capability word of the declared io_device_type / io_subtype, or 0 when no type is declared.

Definition at line 143 of file cover.py.

◆ _default_device_class()

_default_device_class ( config)
protected
Give a cover that declares io_device_type and sets no `device_class:` the kind's Home
Assistant class; an explicit value, including "", is kept.

Definition at line 150 of file cover.py.

◆ _inject_companion_ids()

_inject_companion_ids ( config)
protected
Declare cover companion entity IDs during schema validation for StaticVector sizing.

The named-position buttons are cover-only and gated on the declared kind's capability bits, so
their injection stays here. The always-present companion sensor IDs are delegated to the
shared helper. See platform_common.companion_id_base() for the StaticVector rationale.

Definition at line 208 of file cover.py.

Here is the call graph for this function:

◆ _require_travel_speed_kind()

_require_travel_speed_kind ( config)
protected
Reject `silent:` or `travel_speed:` on a declared kind that takes no travel-speed parameter.

Definition at line 160 of file cover.py.

◆ _silent_replacement()

_silent_replacement ( config)
protected
What a cover with `silent:` writes instead, and what changes in Home Assistant.

Definition at line 288 of file cover.py.

◆ battery_level_sensor_name()

battery_level_sensor_name ( config)
Derive the battery level (percent) sensor name from the parent cover name.

Definition at line 193 of file cover.py.

◆ battery_low_sensor_name()

battery_low_sensor_name ( config)
Derive the battery-low binary sensor name from the parent cover name.

Definition at line 198 of file cover.py.

◆ battery_sensor_name()

battery_sensor_name ( config)
Derive the battery-level text sensor name from the parent cover name.

Definition at line 203 of file cover.py.

◆ rain_sensor_name()

rain_sensor_name ( config)
Derive the rain binary sensor name from the parent cover name.

Definition at line 183 of file cover.py.

◆ silent_switch_name()

silent_switch_name ( config)
Derive the silent-operation switch name from the parent cover name.

Definition at line 173 of file cover.py.

◆ sun_level_sensor_name()

sun_level_sensor_name ( config)
Derive the sun level sensor name from the parent cover name.

Definition at line 188 of file cover.py.

◆ to_code()

to_code ( config)

Definition at line 341 of file cover.py.

Here is the call graph for this function:

◆ travel_speed_select_name()

travel_speed_select_name ( config)
Derive the travel speed select name from the parent cover name.

Definition at line 178 of file cover.py.

Variable Documentation

◆ CONF_BATTERY

str home_io_control.cover.CONF_BATTERY = "battery"

Definition at line 75 of file cover.py.

◆ CONF_BATTERY_LEVEL_POLL_INTERVAL

str home_io_control.cover.CONF_BATTERY_LEVEL_POLL_INTERVAL = "battery_level_poll_interval"

Definition at line 72 of file cover.py.

◆ CONF_BATTERY_LEVEL_SENSOR_ID

str home_io_control.cover.CONF_BATTERY_LEVEL_SENSOR_ID = "_battery_level_sensor_id"

Definition at line 73 of file cover.py.

◆ CONF_BATTERY_LOW_SENSOR_ID

str home_io_control.cover.CONF_BATTERY_LOW_SENSOR_ID = "_battery_low_sensor_id"

Definition at line 76 of file cover.py.

◆ CONF_BATTERY_SENSOR_ID

str home_io_control.cover.CONF_BATTERY_SENSOR_ID = "_battery_sensor_id"

Definition at line 77 of file cover.py.

◆ CONF_FAVORITE_BUTTON_ID

str home_io_control.cover.CONF_FAVORITE_BUTTON_ID = "_favorite_button_id"

Definition at line 80 of file cover.py.

◆ CONF_OPTIMISTIC_STATE

str home_io_control.cover.CONF_OPTIMISTIC_STATE = "optimistic_state"

Definition at line 67 of file cover.py.

◆ CONF_PARTIAL_BUTTON_ID

str home_io_control.cover.CONF_PARTIAL_BUTTON_ID = "_partial_button_id"

Definition at line 82 of file cover.py.

◆ CONF_PEDESTRIAN_BUTTON_ID

str home_io_control.cover.CONF_PEDESTRIAN_BUTTON_ID = "_pedestrian_button_id"

Definition at line 83 of file cover.py.

◆ CONF_RAIN_SENSOR_ID

str home_io_control.cover.CONF_RAIN_SENSOR_ID = "_rain_sensor_id"

Definition at line 69 of file cover.py.

◆ CONF_RAIN_SENSOR_POLL_INTERVAL

str home_io_control.cover.CONF_RAIN_SENSOR_POLL_INTERVAL = "rain_sensor_poll_interval"

Definition at line 68 of file cover.py.

◆ CONF_SILENT

str home_io_control.cover.CONF_SILENT = "silent"

Definition at line 63 of file cover.py.

◆ CONF_SILENT_SWITCH_ID

str home_io_control.cover.CONF_SILENT_SWITCH_ID = "_silent_switch_id"

Definition at line 64 of file cover.py.

◆ CONF_STATUS_REFRESH_INTERVAL

str home_io_control.cover.CONF_STATUS_REFRESH_INTERVAL = "status_refresh_interval"

Definition at line 74 of file cover.py.

◆ CONF_SUN_LEVEL_POLL_INTERVAL

str home_io_control.cover.CONF_SUN_LEVEL_POLL_INTERVAL = "sun_level_poll_interval"

Definition at line 70 of file cover.py.

◆ CONF_SUN_LEVEL_SENSOR_ID

str home_io_control.cover.CONF_SUN_LEVEL_SENSOR_ID = "_sun_level_sensor_id"

Definition at line 71 of file cover.py.

◆ CONF_TRAVEL_SPEED

str home_io_control.cover.CONF_TRAVEL_SPEED = "travel_speed"

Definition at line 65 of file cover.py.

◆ CONF_TRAVEL_SPEED_SELECT_ID

str home_io_control.cover.CONF_TRAVEL_SPEED_SELECT_ID = "_travel_speed_select_id"

Definition at line 66 of file cover.py.

◆ CONF_VENT_BUTTON_ID

str home_io_control.cover.CONF_VENT_BUTTON_ID = "_vent_button_id"

Definition at line 81 of file cover.py.

◆ CONFIG_SCHEMA

home_io_control.cover.CONFIG_SCHEMA

Definition at line 298 of file cover.py.

◆ CoverCommand

home_io_control.cover.CoverCommand = home_io_control_ns.enum("CoverCommand", is_class=True)

Definition at line 126 of file cover.py.

◆ DEPENDENCIES

list home_io_control.cover.DEPENDENCIES = ["home_io_control"]

Definition at line 61 of file cover.py.

◆ IOHomeBatteryLevelSensor

home_io_control.cover.IOHomeBatteryLevelSensor
Initial value:
= home_io_control_ns.class_(
"IOHomeBatteryLevelSensor", sensor.Sensor, cg.Component
)

Definition at line 111 of file cover.py.

◆ IOHomeBatteryLowBinarySensor

home_io_control.cover.IOHomeBatteryLowBinarySensor
Initial value:
= home_io_control_ns.class_(
"IOHomeBatteryLowBinarySensor", binary_sensor.BinarySensor, cg.Component
)

Definition at line 114 of file cover.py.

◆ IOHomeBatteryTextSensor

home_io_control.cover.IOHomeBatteryTextSensor
Initial value:
= home_io_control_ns.class_(
"IOHomeBatteryTextSensor", text_sensor.TextSensor, cg.Component
)

Definition at line 117 of file cover.py.

◆ IOHomeCover

home_io_control.cover.IOHomeCover = home_io_control_ns.class_("IOHomeCover", cover.Cover, cg.Component)

Definition at line 85 of file cover.py.

◆ IOHomeCoverCommandButton

home_io_control.cover.IOHomeCoverCommandButton
Initial value:
= home_io_control_ns.class_(
"IOHomeCoverCommandButton", button.Button, cg.Component
)

Definition at line 123 of file cover.py.

◆ IOHomeCoverSilentSwitch

home_io_control.cover.IOHomeCoverSilentSwitch
Initial value:
= home_io_control_ns.class_(
"IOHomeCoverSilentSwitch", switch.Switch, cg.Component
)

Definition at line 86 of file cover.py.

◆ IOHomeCoverTravelSpeedSelect

home_io_control.cover.IOHomeCoverTravelSpeedSelect
Initial value:
= home_io_control_ns.class_(
"IOHomeCoverTravelSpeedSelect", select.Select, cg.Component
)

Definition at line 89 of file cover.py.

◆ IOHomeRainBinarySensor

home_io_control.cover.IOHomeRainBinarySensor
Initial value:
= home_io_control_ns.class_(
"IOHomeRainBinarySensor", binary_sensor.BinarySensor, cg.Component
)

Definition at line 105 of file cover.py.

◆ IOHomeSunLevelSensor

home_io_control.cover.IOHomeSunLevelSensor
Initial value:
= home_io_control_ns.class_(
"IOHomeSunLevelSensor", sensor.Sensor, cg.Component
)

Definition at line 108 of file cover.py.

◆ NAMED_POSITION_BUTTONS

dict home_io_control.cover.NAMED_POSITION_BUTTONS
Initial value:
= {
"FAVORITE": (CONF_FAVORITE_BUTTON_ID, "favorite_button", "Favorite Position", False),
"VENT": (CONF_VENT_BUTTON_ID, "vent_button", "Ventilation Position", False),
# Disabled by default: the pedestrian value is experimental (no public source), and a garage
# opener runs only the partial position stored in it (issue #163). The user enables them in
# Home Assistant.
"PEDESTRIAN": (CONF_PEDESTRIAN_BUTTON_ID, "pedestrian_button", "Pedestrian Position", True),
"PARTIAL": (CONF_PARTIAL_BUTTON_ID, "partial_button", "Partial Position", True),
}

Definition at line 132 of file cover.py.

◆ TRAVEL_SPEED_EXCLUSIVE_MESSAGE

tuple home_io_control.cover.TRAVEL_SPEED_EXCLUSIVE_MESSAGE
Initial value:
= (
"silent: and travel_speed: set the same thing; keep one "
"(silent: true is travel_speed: silent, silent: false is travel_speed: fast)"
)

Definition at line 101 of file cover.py.

◆ TRAVEL_SPEEDS

dict home_io_control.cover.TRAVEL_SPEEDS
Initial value:
= {
"default": TravelSpeed.MOTOR_DEFAULT,
"silent": TravelSpeed.SILENT,
"fast": TravelSpeed.FAST,
}

Definition at line 96 of file cover.py.

◆ TravelSpeed

home_io_control.cover.TravelSpeed = home_io_control_ns.enum("TravelSpeed", is_class=True)

Definition at line 92 of file cover.py.