Hi,
I have a Somfy Protexiom alarm and I want to integrate it into HA. I found an integration on the internet but it does not integrate correctly because the mechanize package is not installed.
I don’t know how to install it.
Can you help me?
Thanks
The module code:
<
from bs4 import BeautifulSoup
import mechanize
import configparser
import io
import ssl
import re
import json
class SomfyException(Exception):
def init(self, value):
Exception.init(self, value)
self.value = value
def __str__(self):
return repr(self.value)
class Somfy:
def init(self, url, password, codes):
ssl._create_default_https_context = ssl._create_unverified_context
# self.config = config
self.url = url
self.id = id
self.password = password
self.codes = codes
self.browser = mechanize.Browser()
self.browser.set_handle_robots(False)
self.browser.addheaders = [(‘User-agent’, ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36’)]
def __enter__(self):
self.login()
return self
def __exit__(self, type, value, traceback):
self.logout()
/>