Медиа¶
TVEntity¶
Телевизор: управление питанием, громкостью, каналами, источником.
Sber TV entity -- maps HA media_player entities to Sber tv category.
Supports on/off, volume, mute, source selection, channel switching, navigation direction, and custom key commands.
TvEntity
¶
Bases: BaseEntity
Sber TV entity for television and media player devices.
Maps HA media_player entities to the Sber 'tv' category with support for: - On/off control - Volume level (Sber 0-100 integer, HA 0.0-1.0 float) - Mute toggle - Source (input) selection - Channel switching (+/-) - Navigation direction (up/down/left/right/ok)
Initialize TV 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/tv.py
fill_by_ha_state
¶
Parse HA state and update TV attributes.
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/tv.py
create_allowed_values_list
¶
Build allowed values map for TV features.
Per Sber TV reference, only source needs explicit allowed_values
(instance-specific source list). All other TV features (volume_int,
channel, direction, etc.) use Sber cloud defaults and MUST NOT be
overridden — sending extra keys causes silent device rejection.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping feature key to its allowed values descriptor. |
Source code in custom_components/sber_mqtt_bridge/devices/tv.py
to_sber_current_state
¶
Build Sber current state payload with TV attributes.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping entity_id to its Sber state representation. |
Source code in custom_components/sber_mqtt_bridge/devices/tv.py
IntercomEntity¶
Домофон.
Sber Intercom entity -- minimal implementation for intercom devices.
Available only via type override (sber_category: intercom). Supports on/off control and read-only call/unlock features from HA attributes.
INTERCOM_CATEGORY
module-attribute
¶
Sber device category for intercom entities.
IntercomEntity
¶
Bases: OnOffEntity
Sber intercom entity for door intercom devices.
Maps to the Sber 'intercom' category. Available only via type override since there is no standard HA intercom domain.
Supports: - On/off control (inherited from OnOffEntity) - Read-only features from HA attributes: incoming_call, reject_call, unlock
Initialize intercom 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/intercom.py
fill_by_ha_state
¶
Parse HA state and update intercom attributes.
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/intercom.py
to_sber_current_state
¶
Build Sber current state payload with intercom attributes.
Returns:
| Type | Description |
|---|---|
dict[str, dict]
|
Dict mapping entity_id to its Sber state representation. |