Skip to content

Commit

Permalink
Merge pull request #79 from Flameeyes/main
Browse files Browse the repository at this point in the history
fan, vacuum: replace device_state_attributes usage.
  • Loading branch information
Kakise authored Dec 12, 2021
2 parents 6c98772 + 096192a commit 113761c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions custom_components/dyson_local/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
import math
from typing import Callable, List, Optional
from typing import Any, Callable, List, Mapping, Optional

from libdyson import DysonPureCool, DysonPureCoolLink, MessageType
import voluptuous as vol
Expand Down Expand Up @@ -223,8 +223,8 @@ def angle_high(self) -> int:
return self._device.oscillation_angle_high

@property
def device_state_attributes(self) -> dict:
"""Return optional state attributes."""
def extra_state_attributes(self) -> Mapping[str, Any]:
"""Return fan-specific state attributes."""
return {
ATTR_ANGLE_LOW: self.angle_low,
ATTR_ANGLE_HIGH: self.angle_high,
Expand Down
4 changes: 2 additions & 2 deletions custom_components/dyson_local/vacuum.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Vacuum platform for Dyson."""

from typing import Callable, List
from typing import Any, Callable, List, Mapping

from libdyson import (
Dyson360Eye,
Expand Down Expand Up @@ -172,7 +172,7 @@ def supported_features(self) -> int:
return SUPPORTED_FEATURES

@property
def device_state_attributes(self) -> dict:
def extra_state_attributes(self) -> Mapping[str, Any]:
"""Expose the status to state attributes."""
return {
ATTR_POSITION: str(self._device.position),
Expand Down

0 comments on commit 113761c

Please sign in to comment.