Skip to content

Commit 3ecd686

Browse files
committed
v0.7.4
1 parent c38294a commit 3ecd686

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = ["setuptools>=77.0"]
44

55
[project]
66
name = "teslemetry_stream"
7-
version = "0.7.3"
7+
version = "0.7.4"
88
license = "Apache-2.0"
99
description = "Teslemetry Streaming API library for Python"
1010
readme = "README.md"

teslemetry_stream/const.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ def lower(self, value, default: str | None = None) -> str | None:
297297
return option.lower()
298298
return default
299299

300+
def upper(self, value, default: str | None = None) -> str | None:
301+
"""Get the value if it is a valid option."""
302+
if isinstance(value, str):
303+
option = value.replace(self.prefix, "")
304+
if option in self.options:
305+
return option.upper()
306+
return default
307+
300308
@cached_property
301309
def hass_options(self) -> list[str]:
302310
"""Get options in lower case excluding 'Unknown'."""
@@ -307,14 +315,6 @@ def lower_options(self) -> list[str]:
307315
"""Get all options in lower case."""
308316
return [option.lower() for option in self.options]
309317

310-
def upper(self, value, default: str | None = None) -> str | None:
311-
"""Get the value if it is a valid option."""
312-
if isinstance(value, str):
313-
option = value.replace(self.prefix, "")
314-
if option in self.options:
315-
return option.upper()
316-
return default
317-
318318
@cached_property
319319
def upper_options(self) -> list[str]:
320320
"""Get all options in upper case."""

0 commit comments

Comments
 (0)