Added camera functionality

This commit is contained in:
2022-07-13 23:05:27 +00:00
parent 466a5eb5e7
commit e4a65f3077
18 changed files with 355 additions and 223 deletions

View File

@@ -1,20 +1,23 @@
from homeassistant.components.light import LightEntity, ColorMode
from .helpers import setup_platform, BrowserModEntity2
from .helpers import setup_platform, BrowserModEntity
from .const import DOMAIN, DATA_ADDERS
async def async_setup_platform(hass, config_entry, async_add_entities, discoveryInfo = None):
async def async_setup_platform(
hass, config_entry, async_add_entities, discoveryInfo=None
):
hass.data[DOMAIN][DATA_ADDERS]["light"] = async_add_entities
async def async_setup_entry(hass, config_entry, async_add_entities):
await async_setup_platform(hass, {}, async_add_entities)
class BrowserModLight(BrowserModEntity2, LightEntity):
class BrowserModLight(BrowserModEntity, LightEntity):
def __init__(self, coordinator, deviceID, device):
super().__init__(coordinator, deviceID, "Screen")
BrowserModEntity.__init__(self, coordinator, deviceID, "Screen")
LightEntity.__init__(self)
self.device = device
@property
@@ -28,6 +31,7 @@ class BrowserModLight(BrowserModEntity2, LightEntity):
@property
def supported_color_modes(self):
return {ColorMode.BRIGHTNESS}
@property
def color_mode(self):
return ColorMode.BRIGHTNESS