Closed azogue closed 4 years ago
Do not trust Travis on this one :)
Access to HA is mocked in tests. Under HA v0.106.6 it will miserably fail ;-)
Ok will wait for HA 0.108 before merge
Merging #7 into master will increase coverage by
9.61%
. The diff coverage is97.36%
.
@@ Coverage Diff @@
## master #7 +/- ##
==========================================
+ Coverage 87.91% 97.53% +9.61%
==========================================
Files 4 3 -1
Lines 240 81 -159
==========================================
- Hits 211 79 -132
+ Misses 29 2 -27
Impacted Files | Coverage Δ | |
---|---|---|
custom_components/hueremote/implemented_remotes.py | 100% <100%> (ø) |
|
custom_components/hueremote/remote.py | 95.45% <95%> (-4.55%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 5bcc1c2...a3e41bb. Read the comment docs.
Hello, it looks like this will split the Lutron Aurora into two remotes, the button as ZLLSwitch, and the dial as ZLLRelativeRotary. Is there anyway to link them together? Otherwise it could be confusing when more than one is implemented.
Since HASS 0.108 is out and has support for remotes (thanks @azogue) this could be merged, right?
Appears the test failed
Now it is ready to work seamlessly with the latest HA Core, I think, @robmarkcole
BUT, now that remotes are recognized in main hue, this CC is not really necessary anymore (I think that is a good thing!). But this PR makes it work better with HA anyway.
Let's review the current status in the HA-Hue ecosystem:
Main hue registers remote devices, fires events with button presses, and generates battery sensor entities. Also presents the button presses as 'device triggers' for automations :)
This CC:
remote
entities, scan_interval: X
)New Fast-Hue CC (https://github.com/azogue/fasthue):
New EventSensor CC (https://github.com/azogue/eventsensor):
sensor.remote_x
entities are analog to the remote.remote_x
entities created here)IMO (but I cannot be objective here, obviously), the best combination is to use fasthue
+ eventsensor
. And if you don't need to 'see' some entity, the latter is not required. And the former is just to set a faster refresh rate (or make it dynamic). If comfortable with the 5s of the main hue, then no CC is needed!
BTW, the 2 new CC's that I pointed are already in queue to be added to HACS:
but in the meanwhile, they can be used by adding the repos in the HACS config.
The fasthue
one could even be installed and executed without any HA restart! (it was a beautiful surprise to me)
OK great work @azogue! The hue CC ecosystem is getting quite busy, but you give a good summary above. Where do you think is the best location to document this?
cc @robmarkcole, don't merge this one to master yet.
Description
Simplified to its minimal expression, and fully covered, with better HA integration. Instead of handling our data and listen to bridge changes, the platform is registered in the bridges, so it operates like the main platforms
sensor
andbinary_sensor
.Now we do things like HA and rely on its data coordinator to handle the aiohue sensors.
Details
HueRemote_AIOHUEType_
classes for remote entities which extract the state and attributes fromaiohue
sensor data. These are:HueRemoteZLLSwitch
: for RWL021, ROM001 and Z3-1BRL (Hue Dimmer Switch, Hue Smart button, Lutron Aurora).HueRemoteZGPSwitch
: for ZGPSWITCH and FOHSWITCH Hue tap switches.HueRemoteZLLRelativeRotary
: for Z3-1BRL, Lutron Aurora Rotary.remote
platform in the sensor manager data coordinator, so bridge updates will call class constructors to create remote entities :) This change requires ~HA v0.108, as depends on home-assistant/core#32732parse_hue_api_response
and sons, as now we access to eachaiohue
sensor individually in the HA entity. Replace actual definitions to state mappings for each kind of remote, also usingaiohue
press definitions.Notes about convergence with HA
From this point on, the next steps up to a PR for the official integration would require better integration, by using
config_registry
, and some minor changes inside the main hue, so IMO we stop here for the CC, as it is easier to do it on HA directly(I'm already working on it on https://github.com/home-assistant/core/compare/dev...azogue:feature/add-remotes-to-hue)
Also, I have to thank @balloob for his guidance on the remotes refactor :)
BREAKING CHANGE
This PR relies on a small change on HA Core which is not included in the last HA release, so this one won't work on production systems, be advised!