Skip to content

Commit

Permalink
Reference to the right DOMAINS
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl committed Jul 21, 2020
1 parent 67e09af commit f212bc6
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
3 changes: 2 additions & 1 deletion custom_components/tahoma/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
DEVICE_CLASS_OCCUPANCY,
DEVICE_CLASS_OPENING,
DEVICE_CLASS_SMOKE,
DOMAIN as BINARY_SENSOR,
BinarySensorEntity,
)

from .const import BINARY_SENSOR, DOMAIN
from .const import DOMAIN
from .tahoma_device import TahomaDevice

SCAN_INTERVAL = timedelta(seconds=120)
Expand Down
4 changes: 3 additions & 1 deletion custom_components/tahoma/climate.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""Support for TaHoma climate devices."""

from homeassistant.components.climate import DOMAIN as CLIMATE

from .climate_aeh import AtlanticElectricalHeater
from .climate_st import SomfyThermostat
from .const import CLIMATE, DOMAIN
from .const import DOMAIN

AEH = "AtlanticElectricalHeater"
ST = "SomfyThermostat"
Expand Down
4 changes: 3 additions & 1 deletion custom_components/tahoma/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
DEVICE_CLASS_GATE,
DEVICE_CLASS_SHUTTER,
DEVICE_CLASS_WINDOW,
DOMAIN as COVER,
SUPPORT_CLOSE,
SUPPORT_CLOSE_TILT,
SUPPORT_OPEN,
Expand All @@ -22,7 +23,7 @@
CoverEntity,
)

from .const import COVER, DOMAIN
from .const import DOMAIN
from .switch import COMMAND_CYCLE
from .tahoma_device import TahomaDevice

Expand Down Expand Up @@ -101,6 +102,7 @@ class TahomaCover(TahomaDevice, CoverEntity):
def current_cover_position(self):
"""
Return current position of cover.
None is unknown, 0 is closed, 100 is fully open.
"""

Expand Down
3 changes: 2 additions & 1 deletion custom_components/tahoma/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ATTR_BRIGHTNESS,
ATTR_EFFECT,
ATTR_HS_COLOR,
DOMAIN as LIGHT,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_EFFECT,
Expand All @@ -14,7 +15,7 @@
from homeassistant.const import STATE_ON
import homeassistant.util.color as color_util

from .const import COMMAND_OFF, COMMAND_ON, CORE_ON_OFF_STATE, DOMAIN, LIGHT
from .const import COMMAND_OFF, COMMAND_ON, CORE_ON_OFF_STATE, DOMAIN
from .tahoma_device import TahomaDevice

_LOGGER = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/tahoma/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from datetime import timedelta
import logging

from homeassistant.components.lock import LockEntity
from homeassistant.components.lock import DOMAIN as LOCK, LockEntity
from homeassistant.const import STATE_LOCKED

from .const import DOMAIN, LOCK
from .const import DOMAIN
from .tahoma_device import TahomaDevice

_LOGGER = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/tahoma/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from tahoma_api.client import TahomaClient
from tahoma_api.models import Scenario

from homeassistant.components.scene import Scene
from homeassistant.components.scene import DOMAIN as SCENE, Scene

from .const import DOMAIN, SCENE
from .const import DOMAIN

_LOGGER = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion custom_components/tahoma/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
DOMAIN as SENSOR,
ENERGY_WATT_HOUR,
POWER_WATT,
TEMP_CELSIUS,
Expand All @@ -18,7 +19,7 @@
)
from homeassistant.helpers.entity import Entity

from .const import DOMAIN, SENSOR
from .const import DOMAIN
from .tahoma_device import TahomaDevice

_LOGGER = logging.getLogger(__name__)
Expand Down
8 changes: 6 additions & 2 deletions custom_components/tahoma/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
import logging
from typing import Optional

from homeassistant.components.switch import DEVICE_CLASS_SWITCH, SwitchEntity
from homeassistant.components.switch import (
DEVICE_CLASS_SWITCH,
DOMAIN as SWITCH,
SwitchEntity,
)
from homeassistant.const import STATE_ON

from .const import COMMAND_OFF, COMMAND_ON, CORE_ON_OFF_STATE, DOMAIN, SWITCH
from .const import COMMAND_OFF, COMMAND_ON, CORE_ON_OFF_STATE, DOMAIN
from .tahoma_device import TahomaDevice

_LOGGER = logging.getLogger(__name__)
Expand Down

0 comments on commit f212bc6

Please sign in to comment.