Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.

Some attributes incorrect after firmware update #30

Open
AndyBerman opened this issue Mar 9, 2022 · 2 comments
Open

Some attributes incorrect after firmware update #30

AndyBerman opened this issue Mar 9, 2022 · 2 comments

Comments

@AndyBerman
Copy link

I just updated the firmware on my switchbot curtains (foolishly), and now the current_position and battery attributes are incorrect. They appear to be swapped.

@gordallott
Copy link

for anyone else with this issue, changing the last part of cover.py to look like

    @property
    def current_cover_position(self):
        """Return the current position of cover shutter."""
        return 100 - self._device.get_battery_percent()
        #return self._device.get_position()

    def update(self):
        self._device.update()
        self._light = self._device.get_light_level()
        self._battery = self._device.get_position()
        #self._battery = self._device.get_battery_percent()

seems to work okay

@AndyBerman
Copy link
Author

That fixed the problem, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants