|
1 | | -""" |
2 | | -Component to calculate IAQ UK index. |
| 1 | +"""Component to calculate IAQ UK index. |
3 | 2 |
|
4 | 3 | For more details about this component, please refer to |
5 | 4 | https://github.com/Limych/ha-iaquk |
|
8 | 7 | import logging |
9 | 8 | from typing import Any, Dict, Final, List, Optional, Union |
10 | 9 |
|
11 | | -import homeassistant.helpers.config_validation as cv |
12 | 10 | import voluptuous as vol |
| 11 | + |
13 | 12 | from homeassistant.components.sensor import DOMAIN as SENSOR |
14 | 13 | from homeassistant.const import ( |
15 | 14 | ATTR_UNIT_OF_MEASUREMENT, |
|
26 | 25 | ) |
27 | 26 | from homeassistant.core import State, callback |
28 | 27 | from homeassistant.helpers import discovery |
| 28 | +import homeassistant.helpers.config_validation as cv |
29 | 29 | from homeassistant.helpers.event import async_track_state_change |
30 | 30 | from homeassistant.util.temperature import convert as convert_temperature |
31 | 31 |
|
@@ -160,6 +160,7 @@ def __init__( |
160 | 160 |
|
161 | 161 | def async_added_to_hass(self): |
162 | 162 | """Register callbacks.""" |
| 163 | + |
163 | 164 | # pylint: disable=unused-argument |
164 | 165 | @callback |
165 | 166 | def sensor_state_listener(entity, old_state, new_state): |
@@ -245,6 +246,7 @@ def update(self): |
245 | 246 | indexes = {} |
246 | 247 | for src in self._sources: |
247 | 248 | try: |
| 249 | + # pylint: disable=unnecessary-dunder-call |
248 | 250 | idx = self.__getattribute__(f"_{src}_index") |
249 | 251 | _LOGGER.debug("[%s] %s_index=%s", self._entity_id, src, idx) |
250 | 252 | if idx is not None: |
|
0 commit comments