jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
189 stars 46 forks source link

Fix cover entity state #244

Closed kevdliu closed 6 months ago

kevdliu commented 6 months ago

In this commit https://github.com/jason0x43/hacs-hubitat/commit/dd2b4c0d6bbc9121cd8ddbc5d6916ffbe7eee1c2#diff-7e3eb469ea561d69ca0310f49362476a3b29e011f9f01ea8bb4b2d8610c614e2, the is_open() and is_opening() methods got kind of mangled. is_open() was deleted while is_opening() was changed to return true if the cover is open or opening. The result is that cover entities in Home Assistant reports "opening" when they are actually in the "open" state. This PR restores the original behavior.

kevdliu commented 6 months ago

@jason0x43 You probably have enough on your plate right now so I decided to just open a PR 🤣.

jason0x43 commented 6 months ago

The is_open property was actually removed on purpose because Home Assistant cover entities don't support an is_open property. However, you did find the issue -- the is_opening method should be checking for DeviceState.OPENING, not DeviceState.OPEN or DeviceState.PARTIALLY_OPEN.

Could you revise your PR to not add the is_open method, and just keep the fixed return value for is_opening?

kevdliu commented 6 months ago

Ah I see, thanks for the background. I've removed the is_open() method

jason0x43 commented 6 months ago

Thanks!