Skip to content

Commit

Permalink
Fixed cover position.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanU committed Mar 24, 2023
1 parent bc2643f commit 73b1bb6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/mygekko/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
NAME = "MyGekko"
DOMAIN = "mygekko"
DOMAIN_DATA = f"{DOMAIN}_data"
VERSION = "0.0.0"
VERSION = "0.0.4"

ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/"
ISSUE_URL = "https://github.com/stephanu/mygekko/issues"
Expand Down
3 changes: 2 additions & 1 deletion custom_components/mygekko/cover.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Cover platform for MyGekko."""

from math import floor
from typing import Any
from homeassistant.core import callback
from homeassistant.components.cover import ATTR_POSITION, CoverEntity, CoverDeviceClass
Expand Down Expand Up @@ -35,7 +36,7 @@ def _handle_coordinator_update(self) -> None:

@property
def is_closed(self) -> bool | None:
return self._blind.position == 100.00
return floor(self._blind.position) == 0

@property
def current_cover_position(self) -> int | None:
Expand Down
1 change: 1 addition & 0 deletions custom_components/mygekko/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


class MyGekkoEntity(CoordinatorEntity):
_attr_has_entity_name = True
def __init__(self, coordinator, entity: Entity):
super().__init__(coordinator)
self.entity = entity
Expand Down
2 changes: 1 addition & 1 deletion custom_components/mygekko/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"dependencies": [],
"config_flow": true,
"codeowners": ["@stephanu"],
"requirements": ["pymygekko==0.0.4rc11"]
"requirements": ["pymygekko==0.0.4rc12"]
}

0 comments on commit 73b1bb6

Please sign in to comment.