Skip to content

Commit

Permalink
Fix mysensors sensor type lookup (#13574)
Browse files Browse the repository at this point in the history
* Always return a safe default.
  • Loading branch information
MartinHjelmare authored and fabaff committed Mar 31, 2018
1 parent bf44dc4 commit 72fb646
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion homeassistant/components/sensor/mysensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,6 @@ def _get_sensor_type(self):
TEMP_CELSIUS if self.gateway.metric else TEMP_FAHRENHEIT)
sensor_type = SENSORS.get(set_req(self.value_type).name, [None, None])
if isinstance(sensor_type, dict):
sensor_type = sensor_type.get(pres(self.child_type).name)
sensor_type = sensor_type.get(
pres(self.child_type).name, [None, None])
return sensor_type

0 comments on commit 72fb646

Please sign in to comment.