Merge branch 'pytuya_refactoring' into physical_device
This commit is contained in:
@@ -20,6 +20,7 @@ import voluptuous as vol
|
||||
|
||||
from homeassistant.components.fan import (
|
||||
FanEntity,
|
||||
DOMAIN,
|
||||
PLATFORM_SCHEMA,
|
||||
SPEED_LOW,
|
||||
SPEED_MEDIUM,
|
||||
@@ -36,8 +37,6 @@ from .pytuya import TuyaDevice
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
PLATFORM = "fan"
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(BASE_PLATFORM_SCHEMA)
|
||||
|
||||
|
||||
@@ -49,7 +48,7 @@ def flow_schema(dps):
|
||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
"""Setup a Tuya fan based on a config entry."""
|
||||
device, entities_to_setup = prepare_setup_entities(
|
||||
config_entry, PLATFORM
|
||||
config_entry, DOMAIN
|
||||
)
|
||||
if not entities_to_setup:
|
||||
return
|
||||
@@ -70,7 +69,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Set up of the Tuya fan."""
|
||||
return import_from_yaml(hass, config, PLATFORM)
|
||||
return import_from_yaml(hass, config, DOMAIN)
|
||||
|
||||
|
||||
class LocaltuyaFan(FanEntity):
|
||||
|
Reference in New Issue
Block a user