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

Reported state when no alert #15

Closed
jazzyisj opened this issue Apr 7, 2019 · 3 comments
Closed

Reported state when no alert #15

jazzyisj opened this issue Apr 7, 2019 · 3 comments

Comments

@jazzyisj
Copy link

jazzyisj commented Apr 7, 2019

When there is no active alert sensor.weatheralerts state is reported as 'unknown'. Because of this I cannot test to see if the sensor is currently connected and active which I would like to do so I receive a notification the component has not connected for some reason.

Would it be possible to have the sensor report "None" when there are no active alerts instead of "unknown"? Seems like it would be a more intuitive value to report on the front end also.

image

@ludeeus
Copy link
Contributor

ludeeus commented Apr 7, 2019

It does report None it is the frontend that "translate" that to "unknown"

@jazzyisj
Copy link
Author

jazzyisj commented Apr 7, 2019

Thank you for your reply, I can tell by your prolific activity on here you are a busy fellow.

I must be misunderstanding something because for example the sensor.work_holiday sensor visible in the image in my first comment actually reports "None" for a state - in the front end. I can test for "None" to see if there is a holiday, or test for "unknown" to see if the sensor state actually exists.

So with the weatheralerts sensor, how could one differentiate between no active alert and the sensor not existing and/or not being connected?

Weatheralerts Sensor connected but no active alert:
image

** Weatheralerts Sensor not instantiated/connected**
image

@ludeeus
Copy link
Contributor

ludeeus commented Apr 11, 2019

Your work_holyday sensor must be doing something wierdness, that is not the expected behavior, what you see from this sensor is, a sensor have two "modes"

  • No data/unknown state resulting in None
  • Data, resulting in the data being displayed

Difference the tests if it exist or has no data does not make sense, to the user the result is the same, the sensor does not contain data in both scenarios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants