Skip to content

Commit

Permalink
Merge branch 'issues/484' of https://github.com/Ginxo/meross-homeassi…
Browse files Browse the repository at this point in the history
…stant into development

# Conflicts:
#	custom_components/meross_cloud/manifest.json
  • Loading branch information
albertogeniola committed Apr 25, 2024
2 parents 2f91d55 + 80899b9 commit 5a5e82e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions custom_components/meross_cloud/cover.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from typing import Any, Dict
from typing import Any, Dict, Union

from meross_iot.controller.device import BaseDevice
from meross_iot.model.enums import RollerShutterState
Expand Down Expand Up @@ -32,7 +32,7 @@ class GarageOpenerEntityWrapper(MerossDevice, CoverEntity):

def __init__(self,
channel: int,
device: MerossGarageDevice,
device: Union[MerossGarageDevice, GarageOpenerMixin],
device_list_coordinator: DataUpdateCoordinator[Dict[str, HttpDeviceInfo]]):
super().__init__(
device=device,
Expand Down Expand Up @@ -92,7 +92,7 @@ class RollerShutterEntityWrapper(MerossDevice, CoverEntity):

def __init__(self,
channel: int,
device: MerossRollerShutterDevice,
device: Union[MerossRollerShutterDevice, RollerShutterTimerMixin],
device_list_coordinator: DataUpdateCoordinator[Dict[str, HttpDeviceInfo]]):
super().__init__(
device=device,
Expand Down Expand Up @@ -130,6 +130,10 @@ def supported_features(self):
# So we don't support that on HA neither.
return CoverEntityFeature.OPEN | CoverEntityFeature.CLOSE | CoverEntityFeature.STOP

@property
def current_cover_position(self):
return self._device.get_position(channel=self._channel_id)

@property
def is_closed(self):
return self._device.get_position(channel=self._channel_id) == 0
Expand Down

0 comments on commit 5a5e82e

Please sign in to comment.