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

Return off state when the host is not reachable #1

Closed
mellado opened this issue Feb 16, 2019 · 9 comments
Closed

Return off state when the host is not reachable #1

mellado opened this issue Feb 16, 2019 · 9 comments

Comments

@mellado
Copy link
Collaborator

mellado commented Feb 16, 2019

If the wifi module of the AC is off because the power of the AC is off, then the state should be off.
I think that is a better feedback than an exception. On the other hand it will not be possible to switch the AC on.

@fredrike
Copy link
Owner

No, if the wifi module is offline it should be reported as unavailable.

Are you saying that it is not possible to turn on the AC via wifi?

@mellado
Copy link
Collaborator Author

mellado commented Feb 18, 2019

I did not know there was a possibility of having an unavailable state.

It is possible to turn on the AC via wifi as long as the wifi module is reachable in the network. The wifi module will not be reachable if, for instance, it has no power.

@fredrike
Copy link
Owner

fredrike commented Feb 18, 2019

https://developers.home-assistant.io/docs/en/entity_index.html#generic-properties

Name Type Default Description
available boolean True Indiciate if Home Assistant is able to read the state and control the underlying device.

You are however right, there should be a check for this that updates the available property from here https://github.com/fredrike/home-assistant/blob/4ef82d00910ae0b965fe4d3a6325816bec90415a/homeassistant/components/climate/tfiac.py#L72

What kind of exception do you currently get when you can't access the wifi-module?

@mellado
Copy link
Collaborator Author

mellado commented Feb 18, 2019

What kind of exception do you currently get when you can't access the wifi-module?

I will let you know when I can test it but you could test it yourself because I think you do not need the AC in this case.

@mellado
Copy link
Collaborator Author

mellado commented Feb 18, 2019

https://github.com/fredrike/home-assistant/blob/4ef82d00910ae0b965fe4d3a6325816bec90415a/homeassistant/components/climate/tfiac.py#L225 raises a socket.timeout exception.
Do you think it is a good idea to catch that exception in that line and raise a new one of a different kind like "tfiac.unavailable"?

fredrike added a commit that referenced this issue Feb 18, 2019
fredrike added a commit that referenced this issue Feb 18, 2019
fredrike added a commit to fredrike/home-assistant that referenced this issue Feb 18, 2019
fredrike added a commit to fredrike/home-assistant that referenced this issue Feb 18, 2019
@fredrike
Copy link
Owner

I did add this to both sides now..

@mellado
Copy link
Collaborator Author

mellado commented Feb 18, 2019

I would set up available property to true again once you get back the connection. Don't you think?

@fredrike
Copy link
Owner

Yes, sorry, Must have missed that. Could you fix it?

@fredrike fredrike reopened this Feb 18, 2019
@mellado
Copy link
Collaborator Author

mellado commented Feb 18, 2019

Done

fredrike added a commit to fredrike/home-assistant that referenced this issue Mar 11, 2019
fredrike added a commit to fredrike/home-assistant that referenced this issue Mar 18, 2019
fredrike added a commit to fredrike/home-assistant that referenced this issue Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants