Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Alphart <farmio@alphart.net>
  • Loading branch information
spacegaier and farmio committed Feb 23, 2021
1 parent 1ff42f3 commit 7f713f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xknx/devices/cover.py
Expand Up @@ -125,7 +125,7 @@ def __init__(
self.travel_time_up = travel_time_up

self.travelcalculator = TravelCalculator(travel_time_down, travel_time_up)
self.travel_direction_tilt = Optional[TravelStatus]
self.travel_direction_tilt: Optional[TravelStatus] = None

self.device_class = device_class

Expand Down Expand Up @@ -288,7 +288,7 @@ async def set_angle(self, angle: int) -> None:
current_angle = self.current_angle()
self.travel_direction_tilt = (
TravelStatus.DIRECTION_DOWN
if current_angle and angle >= current_angle
if current_angle is not None and angle >= current_angle
else TravelStatus.DIRECTION_UP
)

Expand Down

0 comments on commit 7f713f5

Please sign in to comment.