sanjoyg / dirigera_platform

HomeAssistant Integration for Dirigera Platform
MIT License
122 stars 16 forks source link

Fix Covers position and target level #11

Closed slajob closed 8 months ago

slajob commented 8 months ago

Hi, I make some fixes to make it working. I tested it on my KADRILJ roller blind

  1. Covers level Current_cover_position is a integer so it's not callable.

    File "/workspaces/core/custom_components/dirigera_platform/cover.py", line 95, in current_cover_position
      return self._json_data.attributes.blinds_current_level()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: 'int' object is not callable
  2. Covers control attribute Changed _set_targetposition attribute to _set_targetlevel.

    File "/workspaces/core/custom_components/dirigera_platform/cover.py", line 136, in set_cover_position
    print(self._json_data.set_target_position(position))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'Blind' object has no attribute 'set_target_position'
sanjoyg commented 8 months ago

Thank you @slajob, merged!