Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensor can only return numeric datatypes #220

Open
prairiesnpr opened this issue Oct 2, 2024 · 0 comments · May be fixed by #222 or #224
Open

Sensor can only return numeric datatypes #220

prairiesnpr opened this issue Oct 2, 2024 · 0 comments · May be fixed by #222 or #224
Labels
enhancement New feature or request

Comments

@prairiesnpr
Copy link

A Home Assistant sensor can return multiple datatypes, but we are limited currently to only numeric types.

See:

def formatter(self, value: int | enum.IntEnum) -> int | float | str | None:

This came up when developing a V2 quirk, HA expects a sensor of class TIMESTAMP to return a datetime object, yet this will fail since we are casting to a float.

@dmulcahey dmulcahey added the enhancement New feature or request label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants