Skip to content

Commit

Permalink
Fix supported features for fan and deprecated constants
Browse files Browse the repository at this point in the history
  • Loading branch information
schmittx committed Oct 8, 2024
1 parent bdddd58 commit 4c126bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions custom_components/leviton_decora_smart_wifi/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ def speed_count(self) -> int:
@property
def supported_features(self) -> FanEntityFeature:
"""Flag supported features."""
supported_features = FanEntityFeature.TURN_OFF | FanEntityFeature.TURN_ON
if self.device.can_set_level:
return FanEntityFeature.SET_SPEED
return FanEntityFeature(0)
supported_features = supported_features | FanEntityFeature.SET_SPEED
return supported_features

def turn_on(
self,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/leviton_decora_smart_wifi/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"loggers": [],
"quality_scale": "gold",
"requirements": ["pypng==0.20220715.0", "PyQRCode==1.2.1"],
"version": "1.5.0"
"version": "1.5.1"
}
2 changes: 1 addition & 1 deletion custom_components/leviton_decora_smart_wifi/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
NumberEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, TIME_MINUTES
from homeassistant.const import PERCENTAGE
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
Expand Down

0 comments on commit 4c126bd

Please sign in to comment.