Closed mellado closed 5 years ago
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?
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.
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?
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.
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"?
I did add this to both sides now..
I would set up available property to true again once you get back the connection. Don't you think?
Yes, sorry, Must have missed that. Could you fix it?
Done
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.