Fixing up style errors in line with tox.

This commit is contained in:
sibowler
2021-12-14 06:16:31 +11:00
committed by rospogrigio
parent 61896605b8
commit a0fff6ee2f
3 changed files with 51 additions and 35 deletions

View File

@@ -24,10 +24,12 @@ def flow_schema(dps):
"""Return schema used in config flow."""
return {
vol.Optional(CONF_MIN_VALUE, default=DEFAULT_MIN): vol.All(
vol.Coerce(float), vol.Range(min=-1000000.0, max=1000000.0),
vol.Coerce(float),
vol.Range(min=-1000000.0, max=1000000.0),
),
vol.Required(CONF_MAX_VALUE, default=DEFAULT_MAX): vol.All(
vol.Coerce(float), vol.Range(min=-1000000.0, max=1000000.0),
vol.Coerce(float),
vol.Range(min=-1000000.0, max=1000000.0),
),
}
@@ -46,11 +48,11 @@ class LocaltuyaNumber(LocalTuyaEntity, NumberEntity):
super().__init__(device, config_entry, sensorid, _LOGGER, **kwargs)
self._state = STATE_UNKNOWN
self._minValue = DEFAULT_MIN
if (CONF_MIN_VALUE in self._config):
self._minValue = self._config.get(CONF_MIN_VALUE)
self._min_value = DEFAULT_MIN
if CONF_MIN_VALUE in self._config:
self._min_value = self._config.get(CONF_MIN_VALUE)
self._maxValue = self._config.get(CONF_MAX_VALUE)
self._max_value = self._config.get(CONF_MAX_VALUE)
@property
def value(self) -> float:
@@ -60,12 +62,12 @@ class LocaltuyaNumber(LocalTuyaEntity, NumberEntity):
@property
def min_value(self) -> float:
"""Return the minimum value."""
return self._minValue
return self._min_value
@property
def max_value(self) -> float:
"""Return the maximum value."""
return self._maxValue
return self._max_value
@property
def device_class(self):