Remove temporary variable by only retrieving needed value (#42522)

This commit is contained in:
springstan
2020-11-29 00:44:25 +01:00
committed by GitHub
parent 65ab8cbc71
commit d5efb3e3de
9 changed files with 29 additions and 29 deletions

View File

@@ -85,7 +85,7 @@ class MySensorsSensor(mysensors.device.MySensorsEntity):
@property
def icon(self):
"""Return the icon to use in the frontend, if any."""
_, icon = self._get_sensor_type()
icon = self._get_sensor_type()[1]
return icon
@property
@@ -97,7 +97,7 @@ class MySensorsSensor(mysensors.device.MySensorsEntity):
and set_req.V_UNIT_PREFIX in self._values
):
return self._values[set_req.V_UNIT_PREFIX]
unit, _ = self._get_sensor_type()
unit = self._get_sensor_type()[0]
return unit
def _get_sensor_type(self):