Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.mysensors.helpers Namespace Reference

Functions

vol.Schema default_schema (BaseAsyncGateway gateway, ChildSensor child, ValueType value_type_name)
 
None discover_mysensors_node (HomeAssistant hass, GatewayId gateway_id, int node_id)
 
None discover_mysensors_platform (HomeAssistant hass, GatewayId gateway_id, str platform, list[DevId] new_devices)
 
vol.Schema get_child_schema (BaseAsyncGateway gateway, ChildSensor child, ValueType value_type_name, dict schema)
 
str invalid_msg (BaseAsyncGateway gateway, ChildSensor child, ValueType value_type_name)
 
vol.Schema light_dimmer_schema (BaseAsyncGateway gateway, ChildSensor child, ValueType value_type_name)
 
vol.Schema light_percentage_schema (BaseAsyncGateway gateway, ChildSensor child, ValueType value_type_name)
 
vol.Schema light_rgb_schema (BaseAsyncGateway gateway, ChildSensor child, ValueType value_type_name)
 
vol.Schema light_rgbw_schema (BaseAsyncGateway gateway, ChildSensor child, ValueType value_type_name)
 
None on_unload (HomeAssistant hass, GatewayId gateway_id, Callable fnct)
 
vol.Schema switch_ir_send_schema (BaseAsyncGateway gateway, ChildSensor child, ValueType value_type_name)
 
defaultdict[Platform, list[DevId]] validate_child (GatewayId gateway_id, BaseAsyncGateway gateway, int node_id, ChildSensor child, int|None value_type=None)
 
bool validate_node (BaseAsyncGateway gateway, int node_id)
 
dict[Platform, list[DevId]] validate_set_msg (GatewayId gateway_id, Message msg)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 

Detailed Description

Helper functions for mysensors package.

Function Documentation

◆ default_schema()

vol.Schema homeassistant.components.mysensors.helpers.default_schema ( BaseAsyncGateway  gateway,
ChildSensor  child,
ValueType   value_type_name 
)
Return a default validation schema for value types.

Definition at line 94 of file helpers.py.

◆ discover_mysensors_node()

None homeassistant.components.mysensors.helpers.discover_mysensors_node ( HomeAssistant  hass,
GatewayId  gateway_id,
int   node_id 
)
Discover a MySensors node.

Definition at line 74 of file helpers.py.

◆ discover_mysensors_platform()

None homeassistant.components.mysensors.helpers.discover_mysensors_platform ( HomeAssistant  hass,
GatewayId  gateway_id,
str  platform,
list[DevId]   new_devices 
)
Discover a MySensors platform.

Definition at line 57 of file helpers.py.

◆ get_child_schema()

vol.Schema homeassistant.components.mysensors.helpers.get_child_schema ( BaseAsyncGateway  gateway,
ChildSensor  child,
ValueType  value_type_name,
dict  schema 
)
Return a child schema.

Definition at line 147 of file helpers.py.

◆ invalid_msg()

str homeassistant.components.mysensors.helpers.invalid_msg ( BaseAsyncGateway  gateway,
ChildSensor  child,
ValueType   value_type_name 
)
Return a message for an invalid child during schema validation.

Definition at line 167 of file helpers.py.

◆ light_dimmer_schema()

vol.Schema homeassistant.components.mysensors.helpers.light_dimmer_schema ( BaseAsyncGateway  gateway,
ChildSensor  child,
ValueType   value_type_name 
)
Return a validation schema for V_DIMMER.

Definition at line 103 of file helpers.py.

◆ light_percentage_schema()

vol.Schema homeassistant.components.mysensors.helpers.light_percentage_schema ( BaseAsyncGateway  gateway,
ChildSensor  child,
ValueType   value_type_name 
)
Return a validation schema for V_PERCENTAGE.

Definition at line 112 of file helpers.py.

◆ light_rgb_schema()

vol.Schema homeassistant.components.mysensors.helpers.light_rgb_schema ( BaseAsyncGateway  gateway,
ChildSensor  child,
ValueType   value_type_name 
)
Return a validation schema for V_RGB.

Definition at line 121 of file helpers.py.

◆ light_rgbw_schema()

vol.Schema homeassistant.components.mysensors.helpers.light_rgbw_schema ( BaseAsyncGateway  gateway,
ChildSensor  child,
ValueType   value_type_name 
)
Return a validation schema for V_RGBW.

Definition at line 130 of file helpers.py.

◆ on_unload()

None homeassistant.components.mysensors.helpers.on_unload ( HomeAssistant  hass,
GatewayId  gateway_id,
Callable  fnct 
)
Register a callback to be called when entry is unloaded.

This function is used by platforms to cleanup after themselves.

Definition at line 45 of file helpers.py.

◆ switch_ir_send_schema()

vol.Schema homeassistant.components.mysensors.helpers.switch_ir_send_schema ( BaseAsyncGateway  gateway,
ChildSensor  child,
ValueType   value_type_name 
)
Return a validation schema for V_IR_SEND.

Definition at line 139 of file helpers.py.

◆ validate_child()

defaultdict[Platform, list[DevId]] homeassistant.components.mysensors.helpers.validate_child ( GatewayId  gateway_id,
BaseAsyncGateway  gateway,
int  node_id,
ChildSensor  child,
int | None   value_type = None 
)
Validate a child. Returns a dict mapping hass platform names to list of DevId.

Definition at line 194 of file helpers.py.

◆ validate_node()

bool homeassistant.components.mysensors.helpers.validate_node ( BaseAsyncGateway  gateway,
int  node_id 
)
Validate a node.

Definition at line 186 of file helpers.py.

◆ validate_set_msg()

dict[Platform, list[DevId]] homeassistant.components.mysensors.helpers.validate_set_msg ( GatewayId  gateway_id,
Message   msg 
)
Validate a set message.

Definition at line 176 of file helpers.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.mysensors.helpers._LOGGER = logging.getLogger(__name__)
private

Definition at line 38 of file helpers.py.