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

Functions

 device_supports_position_control (value)
 device_supports_vent (value)
 favorite_button_name (config)
 vent_button_name (config)
 silent_switch_name (config)
 rain_sensor_name (config)
 battery_low_sensor_name (config)
 battery_sensor_name (config)
 _inject_companion_ids (config)
 to_code (config)
 _create_battery_sensors (config, parent)

Variables

list DEPENDENCIES = ["home_io_control"]
str CONF_INVERT_POSITION = "invert_position"
str CONF_SILENT = "silent"
str CONF_SILENT_SWITCH_ID = "_silent_switch_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_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"
 IOHomeCover = home_io_control_ns.class_("IOHomeCover", cover.Cover, cg.Component)
 IOHomeCoverSilentSwitch
 IOHomeRainBinarySensor
 IOHomeBatteryLowBinarySensor
 IOHomeBatteryTextSensor
 IOHomeCoverCommandButton
 CoverCommand = home_io_control_ns.enum("CoverCommand", is_class=True)
dict POSITION_CONTROL_DEVICE_TYPES
dict VENT_DEVICE_TYPES
 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 327 of file cover.py.

Here is the call graph for this function:

◆ _inject_companion_ids()

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

The favorite and ventilation buttons are cover-only and gated on device capability, 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 147 of file cover.py.

Here is the call graph for this function:

◆ battery_low_sensor_name()

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

Definition at line 137 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 142 of file cover.py.

◆ device_supports_position_control()

device_supports_position_control ( value)
Check if the given device type value supports 0-100% position control.

Definition at line 99 of file cover.py.

◆ device_supports_vent()

device_supports_vent ( value)
Check if the given device type value supports the ventilation command.

Definition at line 112 of file cover.py.

◆ favorite_button_name()

favorite_button_name ( config)
Derive the favorite-position button name from the parent cover name.

Definition at line 117 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 132 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 127 of file cover.py.

◆ to_code()

to_code ( config)

Definition at line 230 of file cover.py.

Here is the call graph for this function:

◆ vent_button_name()

vent_button_name ( config)
Derive the ventilation-position button name from the parent cover name.

Definition at line 122 of file cover.py.

Variable Documentation

◆ CONF_BATTERY

str home_io_control.cover.CONF_BATTERY = "battery"

Definition at line 48 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 49 of file cover.py.

◆ CONF_BATTERY_SENSOR_ID

str home_io_control.cover.CONF_BATTERY_SENSOR_ID = "_battery_sensor_id"

Definition at line 50 of file cover.py.

◆ CONF_FAVORITE_BUTTON_ID

str home_io_control.cover.CONF_FAVORITE_BUTTON_ID = "_favorite_button_id"

Definition at line 53 of file cover.py.

◆ CONF_INVERT_POSITION

str home_io_control.cover.CONF_INVERT_POSITION = "invert_position"

Definition at line 42 of file cover.py.

◆ CONF_OPTIMISTIC_STATE

str home_io_control.cover.CONF_OPTIMISTIC_STATE = "optimistic_state"

Definition at line 45 of file cover.py.

◆ CONF_RAIN_SENSOR_ID

str home_io_control.cover.CONF_RAIN_SENSOR_ID = "_rain_sensor_id"

Definition at line 47 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 46 of file cover.py.

◆ CONF_SILENT

str home_io_control.cover.CONF_SILENT = "silent"

Definition at line 43 of file cover.py.

◆ CONF_SILENT_SWITCH_ID

str home_io_control.cover.CONF_SILENT_SWITCH_ID = "_silent_switch_id"

Definition at line 44 of file cover.py.

◆ CONF_VENT_BUTTON_ID

str home_io_control.cover.CONF_VENT_BUTTON_ID = "_vent_button_id"

Definition at line 54 of file cover.py.

◆ CONFIG_SCHEMA

home_io_control.cover.CONFIG_SCHEMA
Initial value:
= cv.All(
cover.cover_schema(IOHomeCover)
.extend(platform_schema_extension())
.extend({cv.Optional(CONF_INVERT_POSITION): cv.boolean})
.extend({cv.Optional(CONF_SILENT): cv.boolean})
.extend(
{
cv.Optional(
CONF_RAIN_SENSOR_POLL_INTERVAL
): validate_rain_sensor_poll_interval
}
)
.extend({cv.Optional(CONF_BATTERY): cv.boolean})
.extend({cv.Optional(CONF_OPTIMISTIC_STATE, default=True): cv.boolean})
.extend(cv.COMPONENT_SCHEMA),
_inject_companion_ids,
)

Definition at line 211 of file cover.py.

◆ CoverCommand

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

Definition at line 75 of file cover.py.

◆ DEPENDENCIES

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

Definition at line 40 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 63 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 66 of file cover.py.

◆ IOHomeCover

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

Definition at line 56 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 72 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 57 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 60 of file cover.py.

◆ POSITION_CONTROL_DEVICE_TYPES

dict home_io_control.cover.POSITION_CONTROL_DEVICE_TYPES
Initial value:
= {
0x01, # interior_venetian_blind
0x02, # roller_shutter
0x03, # vertical_exterior_awning
0x04, # window_opener
0x05, # garage_opener
0x07, # gate_opener
0x08, # rolling_door_opener
0x0A, # vertical_interior_blind
0x0D, # dual_roller_shutter
0x10, # horizontal_awning
0x11, # exterior_venetian_blind
0x12, # louvre_blind
0x13, # curtain_track
0x18, # swinging_shutter
0x1B, # sliding_window
0x1D, # bioclimatic_pergola
}

Definition at line 79 of file cover.py.

◆ VENT_DEVICE_TYPES

dict home_io_control.cover.VENT_DEVICE_TYPES
Initial value:
= {
0x04, # window_opener
0x14, # ventilation_point
}

Definition at line 106 of file cover.py.