Add switches (on/off zones) to geniushub#28182
Conversation
|
Thanks for your PR - we'll definitely get this useful PR merged. |
zxdavb
left a comment
There was a problem hiding this comment.
Please add:
@property
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
return DEVICE_CLASS_OUTLET
Please be aware of the distinction between a GH Device (that is a binary_sensor)), and a GH on/off Zone (a switch). For example, an on/off Zone can have (say) three Devices (smart plugs). All 3 will turn on when the Zone is on, and all three off otherwise. |
I am aware of these however, (see above), I can only see ways to turn on/off whole zones, not individual devices.. At least in the v1 API. |
Aha ok, I took the switch parts from the smartthings/switch.py, which doesn't contain this.. |
Correct. |
|
The problem is, and this is why I haven't been rushing to implement this functionality, that HA switches have no concept of operating mode / profile. That is, they expect to be turned off, and turned on - they have no concept of following a schedule (Timer mode)... So have a think about what you expect this entity to do when it is turned on, and turned off. |
|
Latest push: 857dce0 - should contain all of the suggestions, apart from the discussion on "!= "off" . |
|
FYI: just identified an issue with the geniushub-client, where is can't change the override of an on/off zone. |
|
I felt like crap all weekend... looks like you were busy, what else do we need to poke to make this work as an initial version? I think the set override time (without temp) on the client is needed, as otherwise the on/off only blinks it on for a second or two. Anything else? |
Sorry, got side tracked with another PR (now done). The changes are here: manzanotti/geniushub-client@v0.6.28...toggle_on_off_zones It previous had a default I will have another look tomorrow - in the meantime, could you mark anything resolved as resolved. |
|
Ah awesome, much better!
…On 29 October 2019 21:49:42 GMT+00:00, David Bonnes ***@***.***> wrote:
> Anything else?
Sorry, got side tracked with another PR (now done).
The changes are here:
manzanotti/geniushub-client@v0.6.28...toggle_on_off_zones
It previous had a `duration `of 0 seconds for `override` mode - it is
now 3600 seconds.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#28182 (comment)
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
|
|
Please edit manifest.json to bump the client (NB: 0.6.29): {
"domain": "geniushub",
"name": "Genius Hub",
"documentation": "https://www.home-assistant.io/integrations/geniushub",
"requirements": [
"geniushub-client==0.6.29"
],
"dependencies": [],
"codeowners": ["@zxdavb"]
}... then run: |
I was literally about to look how to do that, well mind read.. |
Hrm, except that updated the reqs.. if I tell it then to install from requirements_all.txt (or just run it), it doesnt update.. I did pip3 install geniushub-client==0.6.29 instead |
|
Hrm. Didnt work - that is, still doesnt set override to an hour.. retested with just latest client from repo to make sure.. doesnt with ghclient either.. time to debug (over on the client repo) |
HA installs the updated client library from PyPI next time you start HA. Confirm this by removing geniushub-client, and restarting HA:
The script in this issue works for me - have a go at it: manzanotti/geniushub-client#25 You can push your latest PR, and I'll have a look. |
Aha, the "remove existing version" wasnt obvious, I assumed it would upgrade if given a higher version.. anyhoo manually got there in the end.
I haven't changed it.. Hm, the ghclient.py one? Aha! I'm just calling --zone=X --mode=override .. which still doesn't send a duration (and I think ought to). |
* In which I learn to run pylint locally..
173705d to
71026ed
Compare
|
Woops - my fault: sorted now (and rebased). |
|
Well done! We can merge as soon as the docs PR is sorted. You're not interested in adding services are you? |
Description:
The geniushub integration shows smart plug Devices as BinarySensors; it can report when they are on or off, but can not change their state (this is done in GH via the parent Zone).
This PR adds on/off Zones as SwitchDevices:
Also bumps geniushub-client from 0.6.28 to 0.6.29, see: manzanotti/geniushub-client@v0.6.28...v0.630, which fixes:
Pull request with documentation for home-assistant.io: home-assistant/home-assistant.io#11095
Checklist:
tox. Your PR cannot be merged unless tests pass - no tests for geniushubIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest. - nothing changedrequirements_all.txtby runningpython3 -m script.gen_requirements_all. - no new ones.coveragerc.