Revert usage of Fibaro Client V5 as it has too many errors (#71477)

This commit is contained in:
rappenze 2022-05-07 22:20:30 +02:00 committed by Paulus Schoutsen
parent 5b4764351d
commit 34cbf26e2f

View File

@ -10,10 +10,7 @@ from fiblary3.client.v4.client import (
Client as FibaroClientV4, Client as FibaroClientV4,
StateHandler as StateHandlerV4, StateHandler as StateHandlerV4,
) )
from fiblary3.client.v5.client import ( from fiblary3.client.v5.client import StateHandler as StateHandlerV5
Client as FibaroClientV5,
StateHandler as StateHandlerV5,
)
from fiblary3.common.exceptions import HTTPException from fiblary3.common.exceptions import HTTPException
import voluptuous as vol import voluptuous as vol
@ -141,18 +138,12 @@ class FibaroController:
should do that only when you use the FibaroController for login test as only should do that only when you use the FibaroController for login test as only
the login and info API's are equal throughout the different versions. the login and info API's are equal throughout the different versions.
""" """
if (
serial_number is None # Only use V4 API as it works better even for HC3, after the library is fixed, we should
or serial_number.upper().startswith("HC2") # add here support for the newer library version V5 again.
or serial_number.upper().startswith("HCL")
):
self._client = FibaroClientV4( self._client = FibaroClientV4(
config[CONF_URL], config[CONF_USERNAME], config[CONF_PASSWORD] config[CONF_URL], config[CONF_USERNAME], config[CONF_PASSWORD]
) )
else:
self._client = FibaroClientV5(
config[CONF_URL], config[CONF_USERNAME], config[CONF_PASSWORD]
)
self._scene_map = None self._scene_map = None
# Whether to import devices from plugins # Whether to import devices from plugins