Skip to content
Snippets Groups Projects
Commit ed6e3495 authored by Jonas Pedersen's avatar Jonas Pedersen Committed by Daniel Høyer Iversen
Browse files

Correct minor comments from PR#20138. (#20454)

parent a85e018b
No related branches found
No related tags found
No related merge requests found
...@@ -55,10 +55,7 @@ class DanfossAir: ...@@ -55,10 +55,7 @@ class DanfossAir:
def get_value(self, item): def get_value(self, item):
"""Get value for sensor.""" """Get value for sensor."""
if item in self._data: return self._data.get(item)
return self._data[item]
return None
@Throttle(MIN_TIME_BETWEEN_UPDATES) @Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self): def update(self):
......
...@@ -9,7 +9,7 @@ from homeassistant.components.danfoss_air import DOMAIN \ ...@@ -9,7 +9,7 @@ from homeassistant.components.danfoss_air import DOMAIN \
as DANFOSS_AIR_DOMAIN as DANFOSS_AIR_DOMAIN
def setup_platform(hass, config, add_devices, discovery_info=None): def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the available Danfoss Air sensors etc.""" """Set up the available Danfoss Air sensors etc."""
from pydanfossair.commands import ReadCommand from pydanfossair.commands import ReadCommand
data = hass.data[DANFOSS_AIR_DOMAIN] data = hass.data[DANFOSS_AIR_DOMAIN]
...@@ -21,7 +21,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): ...@@ -21,7 +21,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
for sensor in sensors: for sensor in sensors:
dev.append(DanfossAirBinarySensor(data, sensor[0], sensor[1])) dev.append(DanfossAirBinarySensor(data, sensor[0], sensor[1]))
add_devices(dev, True) add_entities(dev, True)
class DanfossAirBinarySensor(BinarySensorDevice): class DanfossAirBinarySensor(BinarySensorDevice):
......
...@@ -10,7 +10,7 @@ from homeassistant.const import TEMP_CELSIUS ...@@ -10,7 +10,7 @@ from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
def setup_platform(hass, config, add_devices, discovery_info=None): def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the available Danfoss Air sensors etc.""" """Set up the available Danfoss Air sensors etc."""
from pydanfossair.commands import ReadCommand from pydanfossair.commands import ReadCommand
...@@ -36,19 +36,19 @@ def setup_platform(hass, config, add_devices, discovery_info=None): ...@@ -36,19 +36,19 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
for sensor in sensors: for sensor in sensors:
dev.append(DanfossAir(data, sensor[0], sensor[1], sensor[2])) dev.append(DanfossAir(data, sensor[0], sensor[1], sensor[2]))
add_devices(dev, True) add_entities(dev, True)
class DanfossAir(Entity): class DanfossAir(Entity):
"""Representation of a Sensor.""" """Representation of a Sensor."""
def __init__(self, data, name, sensorUnit, sensorType): def __init__(self, data, name, sensor_unit, sensor_type):
"""Initialize the sensor.""" """Initialize the sensor."""
self._data = data self._data = data
self._name = name self._name = name
self._state = None self._state = None
self._type = sensorType self._type = sensor_type
self._unit = sensorUnit self._unit = sensor_unit
@property @property
def name(self): def name(self):
...@@ -68,7 +68,7 @@ class DanfossAir(Entity): ...@@ -68,7 +68,7 @@ class DanfossAir(Entity):
def update(self): def update(self):
"""Update the new state of the sensor. """Update the new state of the sensor.
This is done through the DanfossAir object tthat does the actually This is done through the DanfossAir object that does the actual
communication with the Air CCM. communication with the Air CCM.
""" """
self._data.update() self._data.update()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment