Use core constants for somfy (#46466)

This commit is contained in:
tkdrob 2021-02-12 17:25:15 -05:00 committed by GitHub
parent bc8a52038b
commit da4cb6d294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 4 additions and 9 deletions

View File

@ -9,7 +9,7 @@ import voluptuous as vol
from homeassistant.components.somfy import config_flow
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.helpers import (
config_entry_oauth2_flow,
@ -25,7 +25,7 @@ from homeassistant.helpers.update_coordinator import (
)
from . import api
from .const import API, CONF_OPTIMISTIC, COORDINATOR, DOMAIN
from .const import API, COORDINATOR, DOMAIN
_LOGGER = logging.getLogger(__name__)

View File

@ -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):
"""Set up the Somfy climate platform."""
domain_data = hass.data[DOMAIN]
coordinator = domain_data[COORDINATOR]
api = domain_data[API]

View File

@ -3,4 +3,3 @@
DOMAIN = "somfy"
COORDINATOR = "coordinator"
API = "api"
CONF_OPTIMISTIC = "optimistic"

View File

@ -18,11 +18,11 @@ from homeassistant.components.cover import (
SUPPORT_STOP_TILT,
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 . 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}
SHUTTER_DEVICE_CATEGORIES = {Category.EXTERIOR_BLIND.value}
@ -35,7 +35,6 @@ SUPPORTED_CATEGORIES = {
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Somfy cover platform."""
domain_data = hass.data[DOMAIN]
coordinator = domain_data[COORDINATOR]
api = domain_data[API]

View File

@ -13,7 +13,6 @@ SUPPORTED_CATEGORIES = {Category.HVAC.value}
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Somfy sensor platform."""
domain_data = hass.data[DOMAIN]
coordinator = domain_data[COORDINATOR]
api = domain_data[API]

View File

@ -10,7 +10,6 @@ from .const import API, COORDINATOR, DOMAIN
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Somfy switch platform."""
domain_data = hass.data[DOMAIN]
coordinator = domain_data[COORDINATOR]
api = domain_data[API]