File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
homeassistant/components/modbus Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -94,18 +94,10 @@ def __init__(
9494 self ._attr_name = entry [CONF_NAME ]
9595 self ._attr_device_class = entry .get (CONF_DEVICE_CLASS )
9696
97- def get_optional_numeric_config (config_name : str ) -> int | float | None :
98- if (val := entry .get (config_name )) is None :
99- return None
100- assert isinstance (val , (float , int )), (
101- f"Expected float or int but { config_name } was { type (val )} "
102- )
103- return val
104-
105- self ._min_value = get_optional_numeric_config (CONF_MIN_VALUE )
106- self ._max_value = get_optional_numeric_config (CONF_MAX_VALUE )
97+ self ._min_value = entry .get (CONF_MIN_VALUE )
98+ self ._max_value = entry .get (CONF_MAX_VALUE )
10799 self ._nan_value = entry .get (CONF_NAN_VALUE )
108- self ._zero_suppress = get_optional_numeric_config (CONF_ZERO_SUPPRESS )
100+ self ._zero_suppress = entry . get (CONF_ZERO_SUPPRESS )
109101
110102 @abstractmethod
111103 async def _async_update (self ) -> None :
You can’t perform that action at this time.
0 commit comments