Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.modbus.validators Namespace Reference

Functions

dict check_config (HomeAssistant hass, dict config)
 
dict duplicate_fan_mode_validator (dict[str, Any] config)
 
dict duplicate_swing_mode_validator (dict[str, Any] config)
 
list hvac_fixedsize_reglist_validator (Any value)
 
None modbus_create_issue (HomeAssistant hass, str key, list[str] subs, str err)
 
int nan_validator (Any value)
 
Any register_int_list_validator (Any value)
 
dict[str, Any] struct_validator (dict[str, Any] config)
 
bool validate_entity (HomeAssistant hass, str hub_name, str component, dict entity, int minimum_scan_interval, set[str] ent_names, set[str] ent_addr)
 
bool validate_modbus (HomeAssistant hass, set[str] hosts, set[str] hub_names, dict hub, int hub_name_inx)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
dictionary DEFAULT_STRUCT_FORMAT
 
string DEMANDED = "D"
 
 ENTRY
 
string ILLEGAL = "I"
 
string OPTIONAL = "O"
 
 PARM_IS_LEGAL
 

Detailed Description

Validate Modbus configuration.

Function Documentation

◆ check_config()

dict homeassistant.components.modbus.validators.check_config ( HomeAssistant  hass,
dict  config 
)
Do final config check.

Definition at line 359 of file validators.py.

◆ duplicate_fan_mode_validator()

dict homeassistant.components.modbus.validators.duplicate_fan_mode_validator ( dict[str, Any]  config)
Control modbus climate fan mode values for duplicates.

Definition at line 229 of file validators.py.

◆ duplicate_swing_mode_validator()

dict homeassistant.components.modbus.validators.duplicate_swing_mode_validator ( dict[str, Any]  config)
Control modbus climate swing mode values for duplicates.

Definition at line 246 of file validators.py.

◆ hvac_fixedsize_reglist_validator()

list homeassistant.components.modbus.validators.hvac_fixedsize_reglist_validator ( Any  value)
Check the number of registers for target temp. and coerce it to a list, if valid.

Definition at line 195 of file validators.py.

◆ modbus_create_issue()

None homeassistant.components.modbus.validators.modbus_create_issue ( HomeAssistant  hass,
str  key,
list[str]  subs,
str   err 
)
Create issue modbus style.

Definition at line 108 of file validators.py.

◆ nan_validator()

int homeassistant.components.modbus.validators.nan_validator ( Any  value)
Convert nan string to number (can be hex string or int).

Definition at line 215 of file validators.py.

◆ register_int_list_validator()

Any homeassistant.components.modbus.validators.register_int_list_validator ( Any  value)
Check if a register (CONF_ADRESS) is an int or a list having only 1 register.

Definition at line 263 of file validators.py.

◆ struct_validator()

dict[str, Any] homeassistant.components.modbus.validators.struct_validator ( dict[str, Any]  config)
Sensor schema validator.

Definition at line 131 of file validators.py.

◆ validate_entity()

bool homeassistant.components.modbus.validators.validate_entity ( HomeAssistant  hass,
str  hub_name,
str  component,
dict  entity,
int  minimum_scan_interval,
set[str]  ent_names,
set[str]  ent_addr 
)
Validate entity.

Definition at line 323 of file validators.py.

◆ validate_modbus()

bool homeassistant.components.modbus.validators.validate_modbus ( HomeAssistant  hass,
set[str]  hosts,
set[str]  hub_names,
dict  hub,
int  hub_name_inx 
)
Validate modbus entries.

Definition at line 277 of file validators.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.modbus.validators._LOGGER = logging.getLogger(__name__)
private

Definition at line 45 of file validators.py.

◆ DEFAULT_STRUCT_FORMAT

dictionary homeassistant.components.modbus.validators.DEFAULT_STRUCT_FORMAT

Definition at line 71 of file validators.py.

◆ DEMANDED

string homeassistant.components.modbus.validators.DEMANDED = "D"

Definition at line 59 of file validators.py.

◆ ENTRY

homeassistant.components.modbus.validators.ENTRY
Initial value:
1 = namedtuple( # noqa: PYI024
2  "ENTRY",
3  [
4  "struct_id",
5  "register_count",
6  "validate_parm",
7  ],
8 )

Definition at line 47 of file validators.py.

◆ ILLEGAL

string homeassistant.components.modbus.validators.ILLEGAL = "I"

Definition at line 57 of file validators.py.

◆ OPTIONAL

string homeassistant.components.modbus.validators.OPTIONAL = "O"

Definition at line 58 of file validators.py.

◆ PARM_IS_LEGAL

homeassistant.components.modbus.validators.PARM_IS_LEGAL
Initial value:
1 = namedtuple( # noqa: PYI024
2  "PARM_IS_LEGAL",
3  [
4  "count",
5  "structure",
6  "slave_count",
7  "swap_byte",
8  "swap_word",
9  ],
10 )

Definition at line 61 of file validators.py.