<commit_before>'''
Home by SFR wrapping class
Plain use of your Home by SFR device from a Python 3 library

Warning:
This is a wrap aroud website, this could stop working without prior notice
'''

# TODO:
## Manage cameras
### Get video

from urllib import request
from http.cookiejar import CookieJar
from urllib.parse import urlencode
from xml.etree import ElementTree as ET
from urllib.error import HTTPError
from datetime import datetime

authors = (
	'Gilles "Almtesh" <NAME>',
)
name = 'homesfr for Python 3'
version = '1.2'

# Settable modes
MODE_OFF = 0
MODE_CUSTOM = 1
MODE_ON = 2

# Sensors names
PRESENCE_DETECTOR = 'PIR_DETECTOR'
MAGNETIC_OPENNING_DETECTOR = 'MAGNETIC'
SMOKE_DETECTOR = 'SMOKE'
SIREN = 'SIREN'
REMOTE_CONTROLER = 'REMOTE'
KEYPAD_CONTROLER = 'KEYPAD'
PRESENCE_CAMERA_DETECTOR = 'PIR_CAMERA'


class Common ():
	'''
	Common ressources to the library's classes
	'''
	
	def __init__ (self):
		
		# Specific configuration
		
		self.base_url = 'https://home.sfr.fr'
		
		# path to login test
		self.auth_path = '/mysensors'
		self.auth_ok_url = 'https://home.sfr.fr/logged'	# if logged
		self.auth_post_url = 'https://boutique.home.sfr.fr/authentification'
		self.auth_referer = 'https://boutique.home.sfr.fr/authentification?back=service'
		self.auth_user_field = 'email'
		self.auth_pass_field = '<PASSWORD>'
		self.auth_extra_fields = {'back': 'service', 'token_sso': '', 'error_sso': '', 'SubmitLogin': 'OK'}
		self.auth_logout_path = '/deconnexion'
		
		# Path to sensors and mode
		self.sensors_list = '/mysensors'
		
		# Path to list of alerts
		self.alerts_path = '/listalert'<commit_msg>Correction du style<commit_after>'''
Home by SFR wrapping class
Plain use of your Home by SFR device from a Python 3 library

Warning:
This is a wrap aroud website, this could stop working without prior notice
'''

# TODO:
## Manage cameras
### Get video

from urllib import request
from http.cookiejar import CookieJar
from urllib.parse import urlencode
from xml.etree import ElementTree as ET
from urllib.error import HTTPError
from datetime import datetime

authors = (
	'Gilles "Almtesh" <NAME>',
)
name = 'homesfr for Python 3'
version = '1.2'

# Settable modes
MODE_OFF = 0
MODE_CUSTOM = 1
MODE_ON = 2

# Sensors names
PRESENCE_DETECTOR = 'PIR_DETECTOR'
MAGNETIC_OPENNING_DETECTOR = 'MAGNETIC'
SMOKE_DETECTOR = 'SMOKE'
SIREN = 'SIREN'
REMOTE_CONTROLER = 'REMOTE'
KEYPAD_CONTROLER = 'KEYPAD'
PRESENCE_CAMERA_DETECTOR = 'PIR_CAMERA'


class Common ():
	'''
	Common ressources to the library's classes
	'''
	
	def __init__ (self):
		
		# Specific configuration
		
		self.base_url = 'https://home.sfr.fr'
		
		# path to login test
		self.auth_path = '/mysensors'
		self.auth_ok_url = 'https://home.sfr.fr/logged'			# if logged
		self.auth_post_url = 'https://boutique.home.sfr.fr/authentification'
		self.auth_referer = 'https://boutique.home.sfr.fr/authentification?back=service'
		self.auth_user_field = 'email'
		self.auth_pass_field = '<PASSWORD>'
		self.auth_extra_fields = {'back': 'service', 'token_sso': '', 'error_sso': '', 'SubmitLogin': 'OK'}
		self.auth_logout_path = '/deconnexion'
		
		# Path to sensors and mode
		self.sensors_list = '/mysensors'
		
		# Path to list of alerts
		self.alerts_path = '/listalert'
{'fraction_non_alphanumeric': 0.11275415896487985, 'fraction_numerical': 0.004313000616142945, 'mean_word_length': 4.420701168614357, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5056064', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1162, 'n_words': 311}