Add custom data type support into Modbus climate (#32439)

This commit is contained in:
Vladimír Záhradník 2020-10-07 22:43:16 +02:00 committed by GitHub
parent 3d9d90c4c8
commit ba84d0bf5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 173 additions and 127 deletions

View file

@ -55,6 +55,11 @@ CONF_ADDRESS = "address"
# sensor.py
# CONF_DATA_TYPE = "data_type"
DEFAULT_STRUCT_FORMAT = {
DATA_TYPE_INT: {1: "h", 2: "i", 4: "q"},
DATA_TYPE_UINT: {1: "H", 2: "I", 4: "Q"},
DATA_TYPE_FLOAT: {1: "e", 2: "f", 4: "d"},
}
# switch.py
CONF_STATE_OFF = "state_off"
@ -63,6 +68,7 @@ CONF_VERIFY_REGISTER = "verify_register"
CONF_VERIFY_STATE = "verify_state"
# climate.py
CONF_CLIMATES = "climates"
CONF_TARGET_TEMP = "target_temp_register"
CONF_CURRENT_TEMP = "current_temp_register"
CONF_CURRENT_TEMP_REGISTER_TYPE = "current_temp_register_type"
@ -72,6 +78,8 @@ CONF_UNIT = "temperature_unit"
CONF_MAX_TEMP = "max_temp"
CONF_MIN_TEMP = "min_temp"
CONF_STEP = "temp_step"
DEFAULT_STRUCTURE_PREFIX = ">f"
DEFAULT_TEMP_UNIT = "C"
# cover.py
CONF_STATE_OPEN = "state_open"