mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Use core constants for somfy (#46466)
This commit is contained in:
parent
bc8a52038b
commit
da4cb6d294
@ -9,7 +9,7 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from homeassistant.components.somfy import config_flow
|
from homeassistant.components.somfy import config_flow
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
|
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, CONF_OPTIMISTIC
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.helpers import (
|
from homeassistant.helpers import (
|
||||||
config_entry_oauth2_flow,
|
config_entry_oauth2_flow,
|
||||||
@ -25,7 +25,7 @@ from homeassistant.helpers.update_coordinator import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from . import api
|
from . import api
|
||||||
from .const import API, CONF_OPTIMISTIC, COORDINATOR, DOMAIN
|
from .const import API, COORDINATOR, DOMAIN
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -48,7 +48,6 @@ HVAC_MODES_MAPPING = {HvacState.COOL: HVAC_MODE_COOL, HvacState.HEAT: HVAC_MODE_
|
|||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||||
"""Set up the Somfy climate platform."""
|
"""Set up the Somfy climate platform."""
|
||||||
|
|
||||||
domain_data = hass.data[DOMAIN]
|
domain_data = hass.data[DOMAIN]
|
||||||
coordinator = domain_data[COORDINATOR]
|
coordinator = domain_data[COORDINATOR]
|
||||||
api = domain_data[API]
|
api = domain_data[API]
|
||||||
|
@ -3,4 +3,3 @@
|
|||||||
DOMAIN = "somfy"
|
DOMAIN = "somfy"
|
||||||
COORDINATOR = "coordinator"
|
COORDINATOR = "coordinator"
|
||||||
API = "api"
|
API = "api"
|
||||||
CONF_OPTIMISTIC = "optimistic"
|
|
||||||
|
@ -18,11 +18,11 @@ from homeassistant.components.cover import (
|
|||||||
SUPPORT_STOP_TILT,
|
SUPPORT_STOP_TILT,
|
||||||
CoverEntity,
|
CoverEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import STATE_CLOSED, STATE_OPEN
|
from homeassistant.const import CONF_OPTIMISTIC, STATE_CLOSED, STATE_OPEN
|
||||||
from homeassistant.helpers.restore_state import RestoreEntity
|
from homeassistant.helpers.restore_state import RestoreEntity
|
||||||
|
|
||||||
from . import SomfyEntity
|
from . import SomfyEntity
|
||||||
from .const import API, CONF_OPTIMISTIC, COORDINATOR, DOMAIN
|
from .const import API, COORDINATOR, DOMAIN
|
||||||
|
|
||||||
BLIND_DEVICE_CATEGORIES = {Category.INTERIOR_BLIND.value, Category.EXTERIOR_BLIND.value}
|
BLIND_DEVICE_CATEGORIES = {Category.INTERIOR_BLIND.value, Category.EXTERIOR_BLIND.value}
|
||||||
SHUTTER_DEVICE_CATEGORIES = {Category.EXTERIOR_BLIND.value}
|
SHUTTER_DEVICE_CATEGORIES = {Category.EXTERIOR_BLIND.value}
|
||||||
@ -35,7 +35,6 @@ SUPPORTED_CATEGORIES = {
|
|||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||||
"""Set up the Somfy cover platform."""
|
"""Set up the Somfy cover platform."""
|
||||||
|
|
||||||
domain_data = hass.data[DOMAIN]
|
domain_data = hass.data[DOMAIN]
|
||||||
coordinator = domain_data[COORDINATOR]
|
coordinator = domain_data[COORDINATOR]
|
||||||
api = domain_data[API]
|
api = domain_data[API]
|
||||||
|
@ -13,7 +13,6 @@ SUPPORTED_CATEGORIES = {Category.HVAC.value}
|
|||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||||
"""Set up the Somfy sensor platform."""
|
"""Set up the Somfy sensor platform."""
|
||||||
|
|
||||||
domain_data = hass.data[DOMAIN]
|
domain_data = hass.data[DOMAIN]
|
||||||
coordinator = domain_data[COORDINATOR]
|
coordinator = domain_data[COORDINATOR]
|
||||||
api = domain_data[API]
|
api = domain_data[API]
|
||||||
|
@ -10,7 +10,6 @@ from .const import API, COORDINATOR, DOMAIN
|
|||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||||
"""Set up the Somfy switch platform."""
|
"""Set up the Somfy switch platform."""
|
||||||
|
|
||||||
domain_data = hass.data[DOMAIN]
|
domain_data = hass.data[DOMAIN]
|
||||||
coordinator = domain_data[COORDINATOR]
|
coordinator = domain_data[COORDINATOR]
|
||||||
api = domain_data[API]
|
api = domain_data[API]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user