def current_cover_tilt_position(self): """Return current position of cover tilt. None is unknown, 0 is closed, 100 is fully open. """ orientation = None try: from pymfy.api.devices.blind import Blind orientation = Blind(self.device, self.api).orientation except StopIteration: pass return orientation
async def async_update(self): """Update the device with the latest data.""" await super().async_update() self.cover = Blind(self.device, self.api)
def __init__(self, device, api, optimistic): """Initialize the Somfy device.""" super().__init__(device, api) self.cover = Blind(self.device, self.api) self.optimistic = optimistic self._closed = None
def __init__(self, device, api): """Initialize the Somfy device.""" super().__init__(device, api) self.cover = Blind(self.device, self.api)
async def async_update(self): """Update the device with the latest data.""" from pymfy.api.devices.blind import Blind await super().async_update() self.cover = Blind(self.device, self.api)
def __init__(self, device, api): """Initialize the Somfy device.""" from pymfy.api.devices.blind import Blind super().__init__(device, api) self.cover = Blind(self.device, self.api)
def _create_device(self) -> Blind: """Update the device with the latest data.""" self._cover = Blind(self.device, self.coordinator.client)
def _create_device(self) -> Blind: """Update the device with the latest data.""" self._cover = Blind( self.device, cast(SomfyDataUpdateCoordinator, self.coordinator).client )
def _create_device(self) -> Blind: """Update the device with the latest data.""" self._cover = Blind(self.device, self.api)
def open_cover_tilt(self, **kwargs): """Open the cover tilt.""" from pymfy.api.devices.blind import Blind Blind(self.device, self.api).orientation = 100
def set_cover_tilt_position(self, **kwargs): """Move the cover tilt to a specific position.""" orientation = kwargs.get(ATTR_TILT_POSITION) from pymfy.api.devices.blind import Blind Blind(self.device, self.api).orientation = orientation
def stop_cover_tilt(self, **kwargs): """Stop the cover.""" from pymfy.api.devices.blind import Blind Blind(self.device, self.api).stop()
def close_cover_tilt(self, **kwargs): """Close the cover tilt.""" from pymfy.api.devices.blind import Blind Blind(self.device, self.api).orientation = 0
def device(self): api = SomfyApi("foo", "faa", "https://whatever.com") device_path = os.path.join(CURRENT_DIR, "blind.json") with open(device_path, "r") as get_device: device = Device(**json.loads(get_device.read())) return Blind(device, api)