sanjoyg / dirigera_platform

HomeAssistant Integration for Dirigera Platform
MIT License
71 stars 8 forks source link

Fix Covers position and target level #11

Closed slajob closed 4 months ago

slajob commented 4 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 4 months ago

Thank you @slajob, merged!