Small collection of random styling tweaks, fixes and Pythonism (#35390)

This commit is contained in:
Franck Nijhof
2020-05-09 00:10:17 +02:00
committed by GitHub
parent 3feb55a8e4
commit 4cf186a47e
14 changed files with 28 additions and 57 deletions

View File

@@ -99,9 +99,11 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Modbus sensors."""
sensors = []
data_types = {DATA_TYPE_INT: {1: "h", 2: "i", 4: "q"}}
data_types[DATA_TYPE_UINT] = {1: "H", 2: "I", 4: "Q"}
data_types[DATA_TYPE_FLOAT] = {1: "e", 2: "f", 4: "d"}
data_types = {
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"},
}
for register in config[CONF_REGISTERS]:
structure = ">i"