@@ -49,7 +49,7 @@ PASSWORD = ""
4949
5050async def main () -> None :
5151 async with OverkizClient(
52- server = SUPPORTED_SERVERS [ Server.SOMFY_EUROPE ] ,
52+ server = Server.SOMFY_EUROPE ,
5353 credentials = UsernamePasswordCredentials(USERNAME , PASSWORD ),
5454 ) as client:
5555 try :
@@ -95,10 +95,8 @@ import time
9595
9696from pyoverkiz.auth.credentials import LocalTokenCredentials
9797from pyoverkiz.client import OverkizClient
98- from pyoverkiz.const import OverkizServer
98+ from pyoverkiz.utils import generate_local_server
9999
100- USERNAME = " "
101- PASSWORD = " "
102100LOCAL_GATEWAY = " gateway-xxxx-xxxx-xxxx.local" # or use the IP address of your gateway
103101VERIFY_SSL = True # set verify_ssl to False if you don't use the .local hostname
104102
@@ -107,12 +105,7 @@ async def main() -> None:
107105 token = " " # generate your token via the Somfy app and include it here
108106
109107 async with OverkizClient(
110- server = OverkizServer(
111- name = " Somfy TaHoma (local)" ,
112- endpoint = f " https:// { LOCAL_GATEWAY } :8443/enduser-mobile-web/1/enduserAPI/ " ,
113- manufacturer = " Somfy" ,
114- configuration_url = None ,
115- ),
108+ server = generate_local_server(host = LOCAL_GATEWAY ),
116109 credentials = LocalTokenCredentials(token),
117110 verify_ssl = VERIFY_SSL ,
118111 ) as client:
0 commit comments