Skip to content

Commit 53f406a

Browse files
author
Ted Roberts
committed
Fix feature flag typing for remote/media_player and release v0.1.22
1 parent 7193a62 commit 53f406a

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

custom_components/kaleidescape_strato/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
}
1616
],
1717
"requirements": [],
18-
"version": "0.1.21"
18+
"version": "0.1.22"
1919
}

custom_components/kaleidescape_strato/media_player.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
PLAYING_STATES = {"playing", "forward", "reverse"}
2424

2525

26-
def _supported_features() -> int:
27-
features = 0
26+
def _supported_features() -> MediaPlayerEntityFeature:
27+
features = MediaPlayerEntityFeature(0)
2828
for feature_name in (
2929
"TURN_ON",
3030
"TURN_OFF",
@@ -34,8 +34,9 @@ def _supported_features() -> int:
3434
"NEXT_TRACK",
3535
"PREVIOUS_TRACK",
3636
):
37-
feature_value = getattr(MediaPlayerEntityFeature, feature_name, 0)
38-
features |= int(feature_value) if feature_value else 0
37+
feature_value = getattr(MediaPlayerEntityFeature, feature_name, None)
38+
if feature_value is not None:
39+
features |= feature_value
3940
return features
4041

4142

custom_components/kaleidescape_strato/remote.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
POWER_OFF_COMMAND = "ENTER_STANDBY"
2424

2525

26-
def _supported_features() -> int:
27-
features = 0
26+
def _supported_features() -> RemoteEntityFeature:
27+
features = RemoteEntityFeature(0)
2828
for feature_name in ("SEND_COMMAND", "TURN_ON", "TURN_OFF", "TOGGLE"):
29-
feature_value = getattr(RemoteEntityFeature, feature_name, 0)
30-
features |= int(feature_value) if feature_value else 0
29+
feature_value = getattr(RemoteEntityFeature, feature_name, None)
30+
if feature_value is not None:
31+
features |= feature_value
3132
return features
3233

3334

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "kaleidescape-strato-ha"
7-
version = "0.1.21"
7+
version = "0.1.22"
88
description = "Home Assistant custom integration for Kaleidescape Strato players"
99
readme = "README.md"
1010
requires-python = ">=3.12"

0 commit comments

Comments
 (0)