Skip to content
Snippets Groups Projects
Commit c144770f authored by jkerdreu's avatar jkerdreu
Browse files

- Drop schemas dep

- Fix Light stuff (more to come) :rage:



git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@3223 b32b6428-25c9-4566-ad07-03861ab6144f
parent c9676cc2
Branches
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@ from homeassistant.helpers import entity_registry
from homeassistant.helpers.entity_registry import EVENT_ENTITY_REGISTRY_UPDATED
from xaal.lib import AsyncEngine, tools, Device, Message, bindings
from xaal.schemas import devices as schemas
from xaal.monitor import Monitor, Notification
from xaal.monitor.monitor import Device as MonitorDevice
......@@ -220,8 +219,8 @@ class Bridge(object):
#####################################################
def setup_device(self) -> Device:
"""setup a new device need by the Monitor"""
dev = schemas.hmi()
dev.dev_type = 'hmi.hass'
dev = Device('hmi.hass')
dev.address = tools.get_random_uuid()
dev.vendor_id = 'IMT Atlantique'
dev.product_id = 'xAAL to HASS Brigde'
# never use this terrible hack to gain access to brigde throught aioconsole
......@@ -410,4 +409,3 @@ class Bridge(object):
@functools.lru_cache(maxsize=128)
def warm_once(self, msg: str):
_LOGGER.warning(msg)
......@@ -21,7 +21,7 @@ async def async_setup_entry(hass: HomeAssistant,
class Lamp(XAALEntity, LightEntity):
@property
def supported_color_modes(self) -> str:
def supported_color_modes(self) -> ColorMode | set[str] | None:
dev_type = self._dev.dev_type
if dev_type in ['lamp.color']:
return {ColorMode.BRIGHTNESS, ColorMode.HS, ColorMode.COLOR_TEMP}
......@@ -85,4 +85,3 @@ class Lamp(XAALEntity, LightEntity):
def turn_off(self, **kwargs) -> None:
self.send_request('turn_off')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment