Шторы и ворота¶
CurtainEntity¶
Шторы/жалюзи с управлением позицией.
Sber Curtain entity -- maps HA cover entities to Sber curtain category.
CURTAIN_ENTITY_CATEGORY
module-attribute
¶
Sber device category for curtain/cover entities.
CurtainEntity
¶
CurtainEntity(entity_data, category=CURTAIN_ENTITY_CATEGORY)
Bases: BaseEntity
Sber curtain entity for cover control with position support.
Maps HA cover entities to the Sber 'curtain' category with support for: - Position control (0-100%) - Open/close/stop commands - Open state reporting
Initialize curtain entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_data
|
dict
|
HA entity registry dict containing entity metadata. |
required |
category
|
str
|
Sber device category (override in subclasses). |
CURTAIN_ENTITY_CATEGORY
|
Source code in custom_components/sber_mqtt_bridge/devices/curtain.py
min_position
class-attribute
instance-attribute
¶
Minimum allowed position (0-100%).
max_position
class-attribute
instance-attribute
¶
Maximum allowed position (0-100%).
battery_level
class-attribute
instance-attribute
¶
Battery level percentage (0-100%).
current_position
class-attribute
instance-attribute
¶
Current cover position (0-100%).
fill_by_ha_state
¶
Update state from Home Assistant data.
Reads current_position from attributes; falls back to 100
if state is 'opened', otherwise 0. Also reads signal strength
from signal_strength, rssi, or linkquality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ha_state
|
dict
|
HA state dict with 'state' and 'attributes' keys. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/curtain.py
update_linked_data
¶
Inject data from a linked entity (battery, battery_low, signal).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role
|
str
|
Link role name. |
required |
ha_state
|
dict
|
HA state dict with 'state'. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/curtain.py
process_cmd
¶
Process Sber curtain commands and produce HA service calls.
Handles the following Sber keys:
- open_percentage: set_cover_position (INTEGER 0-100)
- cover_position: set_cover_position (INTEGER 0-100)
- open_set: open_cover / close_cover / stop_cover (ENUM)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cmd_data
|
dict
|
Sber command dict with 'states' list. |
required |
Returns:
| Type | Description |
|---|---|
list[dict]
|
List of HA service call dicts to execute. |
Source code in custom_components/sber_mqtt_bridge/devices/curtain.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
create_features_list
¶
Return Sber feature list for curtain capabilities.
Includes open_percentage, open_set, open_state, and optionally signal_strength features.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of Sber feature strings supported by this entity. |
Source code in custom_components/sber_mqtt_bridge/devices/curtain.py
create_allowed_values_list
¶
Return allowed values for open_set, open_percentage, and open_rate features.
Source code in custom_components/sber_mqtt_bridge/devices/curtain.py
to_sber_current_state
¶
Build Sber current state payload with position, open state, and signal.
Per Sber C2C specification, integer_value is serialized as a string.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping entity_id to its Sber state representation. |
Source code in custom_components/sber_mqtt_bridge/devices/curtain.py
WindowBlindEntity¶
Оконные жалюзи с управлением наклоном.
Sber Window Blind entity -- maps HA blind/shade/shutter covers to Sber window_blind.
WINDOW_BLIND_CATEGORY
module-attribute
¶
Sber device category for window blind/shade/shutter entities.
WindowBlindEntity
¶
Bases: CurtainEntity
Sber window blind entity for blind/shade/shutter devices.
Inherits all curtain behavior (position control, open/close/stop) but registers under the Sber 'window_blind' category.
Initialize window blind entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_data
|
dict
|
HA entity registry dict containing entity metadata. |
required |
Source code in custom_components/sber_mqtt_bridge/devices/window_blind.py
GateEntity¶
Ворота/калитка.
Sber Gate entity -- maps HA cover (gate/garage_door) entities to Sber gate category.
GATE_ENTITY_CATEGORY
module-attribute
¶
Sber device category for gate/garage door entities.
GateEntity
¶
Bases: CurtainEntity
Sber gate entity for gate/garage door control.
Inherits all curtain functionality (position, open/close/stop) but uses the Sber 'gate' category instead of 'curtain'.
Maps HA cover entities with device_class 'gate' or 'garage_door'.
Initialize gate entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_data
|
dict
|
HA entity registry dict containing entity metadata. |
required |