jaraco / jaraco.abode

MIT License
11 stars 9 forks source link

Add support for light_bulb #26

Closed jaraco closed 5 months ago

jaraco commented 7 months ago
jaraco commented 7 months ago

@darrick In this PR (feature/light-bulb branch), I've attempted to reconcile your patch with the later changes in the package. You can see the test failures that result:

FAILED tests/test_dimmer.py::TestDimmer::test_dimmer_status_changes - requests_mock.exceptions.NoMockAddress: No mock address: POST https://my.go.../
FAILED tests/test_hue.py::TestHue::test_hue_device_properties - assert False
FAILED tests/test_hue.py::TestHue::test_hue_status_changes - requests_mock.exceptions.NoMockAddress: No mock address: POST https://my.go.../

The "No mock address" means that those tests don't have responses configured for the new POST requests introduced by Light.set_status and .set_level.

So right off the bat, it looks like the dimmer and hue depend on the base.Device.set_status and .set_level, so overriding them for one type of device (light_bulb) isn't going to work.

I'm not sure what the right solution might be, but my instinct is there maybe should be another class for this type of device.

Additionally, I'd like to see some tests, similar to what you see in test_hue and test_dimmer, but for a light bulb.

I know you started working against v3.3, but I'm hoping this branch will help you work against the latest code, which is much cleaner. Are you able to use later releases of jaraco.abode in your home assistant environment? Do you know if home assistant has been able to adapt to the changes in v4 and v5 (history)?