Skip to content

Commit 8dc33ec

Browse files
authored
Remove sensor from _IGNORE_ROOT_IMPORT in pylint plugin (home-assistant#154602)
1 parent 3d4d8e7 commit 8dc33ec

File tree

11 files changed

+31
-13
lines changed

11 files changed

+31
-13
lines changed

homeassistant/components/eheimdigital/sensor.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
from eheimdigital.device import EheimDigitalDevice
99
from eheimdigital.types import FilterErrorCode
1010

11-
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
12-
from homeassistant.components.sensor.const import SensorDeviceClass
11+
from homeassistant.components.sensor import (
12+
SensorDeviceClass,
13+
SensorEntity,
14+
SensorEntityDescription,
15+
)
1316
from homeassistant.const import PERCENTAGE, EntityCategory, UnitOfTime
1417
from homeassistant.core import HomeAssistant
1518
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback

homeassistant/components/energy/sensor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
SensorEntity,
1717
SensorStateClass,
1818
)
19-
from homeassistant.components.sensor.recorder import reset_detected
19+
from homeassistant.components.sensor.recorder import ( # pylint: disable=hass-component-root-import
20+
reset_detected,
21+
)
2022
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, UnitOfEnergy, UnitOfVolume
2123
from homeassistant.core import (
2224
HomeAssistant,

homeassistant/components/eq3btsmart/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
SensorDeviceClass,
1111
SensorEntity,
1212
SensorEntityDescription,
13+
SensorStateClass,
1314
)
14-
from homeassistant.components.sensor.const import SensorStateClass
1515
from homeassistant.const import PERCENTAGE
1616
from homeassistant.core import HomeAssistant
1717
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback

homeassistant/components/firefly_iii/sensor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
from pyfirefly.models import Account, Category
66

7-
from homeassistant.components.sensor import SensorEntity, SensorStateClass, StateType
8-
from homeassistant.components.sensor.const import SensorDeviceClass
7+
from homeassistant.components.sensor import (
8+
SensorDeviceClass,
9+
SensorEntity,
10+
SensorStateClass,
11+
StateType,
12+
)
913
from homeassistant.const import EntityCategory
1014
from homeassistant.core import HomeAssistant
1115
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback

homeassistant/components/template/sensor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
SensorEntity,
2222
SensorStateClass,
2323
)
24-
from homeassistant.components.sensor.helpers import async_parse_date_datetime
24+
from homeassistant.components.sensor.helpers import ( # pylint: disable=hass-component-root-import
25+
async_parse_date_datetime,
26+
)
2527
from homeassistant.config_entries import ConfigEntry
2628
from homeassistant.const import (
2729
ATTR_ENTITY_ID,

homeassistant/components/utility_meter/sensor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
SensorExtraStoredData,
2121
SensorStateClass,
2222
)
23-
from homeassistant.components.sensor.recorder import _suggest_report_issue
23+
from homeassistant.components.sensor.recorder import ( # pylint: disable=hass-component-root-import
24+
_suggest_report_issue,
25+
)
2426
from homeassistant.config_entries import ConfigEntry
2527
from homeassistant.const import (
2628
ATTR_DEVICE_CLASS,

homeassistant/helpers/trigger_template_entity.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
SensorDeviceClass,
1717
SensorEntity,
1818
)
19-
from homeassistant.components.sensor.helpers import async_parse_date_datetime
19+
from homeassistant.components.sensor.helpers import ( # pylint: disable=hass-component-root-import
20+
async_parse_date_datetime,
21+
)
2022
from homeassistant.const import (
2123
ATTR_ENTITY_PICTURE,
2224
ATTR_FRIENDLY_NAME,

pylint/plugins/hass_imports.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ class ObsoleteImportMatch:
144144
"recorder",
145145
"rest",
146146
"script",
147-
"sensor",
148147
"stream",
149148
)
150149

tests/components/cups/test_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from unittest.mock import patch
44

55
from homeassistant.components.cups import CONF_PRINTERS, DOMAIN
6-
from homeassistant.components.sensor.const import DOMAIN as SENSOR_DOMAIN
6+
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
77
from homeassistant.const import CONF_PLATFORM
88
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant
99
from homeassistant.helpers import issue_registry as ir

tests/components/energy/test_sensor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
SensorDeviceClass,
1818
SensorStateClass,
1919
)
20-
from homeassistant.components.sensor.recorder import compile_statistics
20+
from homeassistant.components.sensor.recorder import ( # pylint: disable=hass-component-root-import
21+
compile_statistics,
22+
)
2123
from homeassistant.const import (
2224
ATTR_DEVICE_CLASS,
2325
ATTR_UNIT_OF_MEASUREMENT,

0 commit comments

Comments
 (0)