mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 01:07:10 +00:00
moved imports to top level (#27509)
This commit is contained in:
parent
ae5cb82908
commit
b9d54de09b
@ -4,6 +4,8 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import brottsplatskartan
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
@ -60,7 +62,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
"""Set up the Brottsplatskartan platform."""
|
"""Set up the Brottsplatskartan platform."""
|
||||||
import brottsplatskartan
|
|
||||||
|
|
||||||
area = config.get(CONF_AREA)
|
area = config.get(CONF_AREA)
|
||||||
latitude = config.get(CONF_LATITUDE, hass.config.latitude)
|
latitude = config.get(CONF_LATITUDE, hass.config.latitude)
|
||||||
@ -105,7 +106,6 @@ class BrottsplatskartanSensor(Entity):
|
|||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update device state."""
|
"""Update device state."""
|
||||||
import brottsplatskartan
|
|
||||||
|
|
||||||
incident_counts = defaultdict(int)
|
incident_counts = defaultdict(int)
|
||||||
incidents = self._brottsplatskartan.get_incidents()
|
incidents = self._brottsplatskartan.get_incidents()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user