Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions homeassistant/components/demo/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def __init__(self, hass, name: str, supported_features: int) -> None:
self._supported_features = supported_features
self._speed = STATE_OFF
self.oscillating = None
self.direction = None
self._direction = None
self._name = name

if supported_features & SUPPORT_OSCILLATE:
self.oscillating = False
if supported_features & SUPPORT_DIRECTION:
self.direction = "forward"
self._direction = "forward"

@property
def name(self) -> str:
Expand Down Expand Up @@ -80,7 +80,7 @@ def set_speed(self, speed: str) -> None:

def set_direction(self, direction: str) -> None:
"""Set the direction of the fan."""
self.direction = direction
self._direction = direction
self.schedule_update_ha_state()

def oscillate(self, oscillating: bool) -> None:
Expand All @@ -91,7 +91,7 @@ def oscillate(self, oscillating: bool) -> None:
@property
def current_direction(self) -> str:
"""Fan direction."""
return self.direction
return self._direction

@property
def supported_features(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/fan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"speed": ATTR_SPEED,
"speed_list": ATTR_SPEED_LIST,
"oscillating": ATTR_OSCILLATING,
"direction": ATTR_DIRECTION,
"current_direction": ATTR_DIRECTION,
} # type: dict

FAN_SET_SPEED_SCHEMA = ENTITY_SERVICE_SCHEMA.extend(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/template/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def oscillating(self):
return self._oscillating

@property
def direction(self):
def current_direction(self):
"""Return the oscillation state."""
return self._direction

Expand Down