From 78e2cf46aeb99bf9f0514024e547cf829e6c6c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Matheson=20Wergeland?= Date: Fri, 12 Jul 2024 21:29:04 +0200 Subject: [PATCH] Added ConnectLife API test server (#8) --- DEVELOPMENT | 4 - DEVELOPMENT.md | 33 ++ connectlife/api.py | 77 ++-- dumps/Asko_dishwasher.json | 292 +++++++------ dumps/Asko_induction_hob_2.json | 121 +++++- dumps/Gorenje_dishwasher.json | 292 +++++++------ dumps/Heat_pump.json | 3 +- dumps/airCondDumpHisense.json | 138 +++--- dumps/hisenserefrigeratordump.json | 652 ++++++++++++++--------------- dumps/test_server.py | 78 ++++ 10 files changed, 958 insertions(+), 732 deletions(-) delete mode 100644 DEVELOPMENT create mode 100644 DEVELOPMENT.md create mode 100644 dumps/test_server.py diff --git a/DEVELOPMENT b/DEVELOPMENT deleted file mode 100644 index df8ee47..0000000 --- a/DEVELOPMENT +++ /dev/null @@ -1,4 +0,0 @@ -pyenv install -python -m venv venv -source venv/bin/activate -pip install . diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..9d226b0 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,33 @@ +# Development environment + +## Prerequisites: + +- [pyenv](https://github.com/pyenv/pyenv) + +## Install environment + +```bash +pyenv install +python -m venv venv +source venv/bin/activate +pip install . +``` + +## Test server + +Test server that mocks the ConnectLife API. Runs on `http://localhost:8080`. + +The server reads all JSON files in the current directory, and serves them as appliances. Properties can be updated, +but is not persisted. The only validation is that the `puid` and `property` exists, it assumes that all properties +are writable and that any value is legal. + +```bash +cd dumps +python -m test_server +``` + +To use the test server, provide the URL to the test server: +```python +from connectlife.api import ConnectLifeApi +api = ConnectLifeApi(username="user@example.com", password="password", test_server="http://localhost:8080") +``` diff --git a/connectlife/api.py b/connectlife/api.py index fb1d8d2..69dec30 100644 --- a/connectlife/api.py +++ b/connectlife/api.py @@ -7,19 +7,6 @@ from .appliance import ConnectLifeAppliance -API_KEY = "4_yhTWQmHFpZkQZDSV1uV-_A" -CLIENT_ID = "5065059336212" -CLIENT_SECRET = "07swfKgvJhC3ydOUS9YV_SwVz0i4LKqlOLGNUukYHVMsJRF1b-iWeUGcNlXyYCeK" - -LOGIN_URL = "https://accounts.eu1.gigya.com/accounts.login" -JWT_URL = "https://accounts.eu1.gigya.com/accounts.getJWT" - -OAUTH2_REDIRECT = "https://api.connectlife.io/swagger/oauth2-redirect.html" -OAUTH2_AUTHORIZE = "https://oauth.hijuconn.com/oauth/authorize" -OAUTH2_TOKEN = "https://oauth.hijuconn.com/oauth/token" - -APPLIANCES_URL = "https://connectlife.bapi.ovh/appliances" - _LOGGER = logging.getLogger(__name__) @@ -32,8 +19,29 @@ class LifeConnectAuthError(Exception): class ConnectLifeApi: - def __init__(self, username: str, password: str): + api_key = "4_yhTWQmHFpZkQZDSV1uV-_A" + client_id = "5065059336212" + client_secret = "07swfKgvJhC3ydOUS9YV_SwVz0i4LKqlOLGNUukYHVMsJRF1b-iWeUGcNlXyYCeK" + + login_url = "https://accounts.eu1.gigya.com/accounts.login" + jwt_url = "https://accounts.eu1.gigya.com/accounts.getJWT" + + oauth2_redirect = "https://api.connectlife.io/swagger/oauth2-redirect.html" + oauth2_authorize = "https://oauth.hijuconn.com/oauth/authorize" + oauth2_token = "https://oauth.hijuconn.com/oauth/token" + + appliances_url = "https://connectlife.bapi.ovh/appliances" + + def __init__(self, username: str, password: str, test_server: str = None): """Initialize the auth.""" + if test_server: + self.login_url = f"{test_server}/accounts.login" + self.jwt_url = f"{test_server}/accounts.getJWT" + self.oauth2_redirect = f"{test_server}/swagger/oauth2-redirect.html" + self.oauth2_authorize = f"{test_server}/oauth/authorize" + self.oauth2_token = f"{test_server}/oauth/token" + self.appliances_url = f"{test_server}/appliances" + self._username = username self._password = password self._access_token: str | None = None @@ -44,10 +52,10 @@ def __init__(self, username: str, password: str): async def authenticate(self) -> bool: """Test if we can authenticate with the host.""" async with aiohttp.ClientSession() as session: - async with session.post(LOGIN_URL, data={ + async with session.post(self.login_url, data={ "loginID": self._username, "password": self._password, - "APIKey": API_KEY, + "APIKey": self.api_key, }) as response: if response.status == 200: body = await self._json(response) @@ -67,7 +75,7 @@ async def get_appliances_json(self) -> Any: """Make a request and return the response as text.""" await self._fetch_access_token() async with aiohttp.ClientSession() as session: - async with session.get(APPLIANCES_URL, headers={ + async with session.get(self.appliances_url, headers={ "User-Agent": "connectlife-api-connector 2.1.4", "X-Token": self._access_token }) as response: @@ -86,7 +94,7 @@ async def update_appliance(self, puid: str, properties: dict[str, str]): _LOGGER.debug("Updating appliance with puid %s to %s", puid, json.dumps(properties)) await self._fetch_access_token() async with aiohttp.ClientSession() as session: - async with session.post(APPLIANCES_URL, json=data, headers={ + async with session.post(self.appliances_url, json=data, headers={ "User-Agent": "connectlife-api-connector 2.1.4", "X-Token": self._access_token }) as response: @@ -102,10 +110,10 @@ async def _fetch_access_token(self): async def _initial_access_token(self): async with aiohttp.ClientSession() as session: - async with session.post(LOGIN_URL, data={ + async with session.post(self.login_url, data={ "loginID": self._username, "password": self._password, - "APIKey": API_KEY, + "APIKey": self.api_key }) as response: if response.status != 200: _LOGGER.debug(f"Response status code: {response.status}") @@ -116,8 +124,8 @@ async def _initial_access_token(self): uid = body["UID"] login_token = body["sessionInfo"]["cookieValue"] - async with session.post(JWT_URL, data={ - "APIKey": API_KEY, + async with session.post(self.jwt_url, data={ + "APIKey": self.api_key, "login_token": login_token }) as response: if response.status != 200: @@ -128,9 +136,9 @@ async def _initial_access_token(self): body = await self._json(response) id_token = body["id_token"] - async with session.post(OAUTH2_AUTHORIZE, json={ - "client_id": CLIENT_ID, - "redirect_uri": OAUTH2_REDIRECT, + async with session.post(self.oauth2_authorize, json={ + "client_id": self.client_id, + "redirect_uri": self.oauth2_redirect, "idToken": id_token, "response_type": "code", "thirdType": "CDC", @@ -144,10 +152,10 @@ async def _initial_access_token(self): body = await response.json() code = body["code"] - async with session.post(OAUTH2_TOKEN, data={ - "client_id": CLIENT_ID, - "client_secret": CLIENT_SECRET, - "redirect_uri": OAUTH2_REDIRECT, + async with session.post(self.oauth2_token, data={ + "client_id": self.client_id, + "client_secret": self.client_secret, + "redirect_uri": self.oauth2_redirect, "grant_type": "authorization_code", "code": code, }) as response: @@ -164,10 +172,10 @@ async def _initial_access_token(self): async def _refresh_access_token(self) -> None: async with aiohttp.ClientSession() as session: - async with session.post(OAUTH2_TOKEN, data={ - "client_id": CLIENT_ID, - "client_secret": CLIENT_SECRET, - "redirect_uri": OAUTH2_REDIRECT, + async with session.post(self.oauth2_token, data={ + "client_id": self.client_id, + "client_secret": self.client_secret, + "redirect_uri": self.oauth2_redirect, "grant_type": "refresh_token", "refresh_token": self._refresh_token, }) as response: @@ -181,7 +189,8 @@ async def _refresh_access_token(self) -> None: # Renew 90 seconds before expiration self._expires = dt.datetime.now() + dt.timedelta(0, body["expires_in"] - 90) - async def _json(self, response: aiohttp.ClientResponse) -> Any: + @staticmethod + async def _json(response: aiohttp.ClientResponse) -> Any: # response may have wrong content-type, cannot use response.json() text = await response.text() _LOGGER.debug(f"response: {text}") diff --git a/dumps/Asko_dishwasher.json b/dumps/Asko_dishwasher.json index f58cd72..363c90c 100644 --- a/dumps/Asko_dishwasher.json +++ b/dumps/Asko_dishwasher.json @@ -1,147 +1,145 @@ -[ - { - "bindTime": 1668542674215, - "createTime": 0, - "deviceFeatureCode": "000", - "deviceFeatureName": "W-DW50/60-22", - "deviceId": "", - "deviceNickName": "Oppvaskmaskin", - "deviceTypeCode": "015", - "deviceTypeName": "", - "offlineState": 1, - "puid": "", - "role": 1, - "roomId": 1044366, - "roomName": "Kj\u00f8kken", - "seq": 0, - "statusList": { - "ADO_allowed": "1", - "Alarm_auto_dose_refill": "1", - "Alarm_clean_the_filters": "1", - "Alarm_door_closed": "1", - "Alarm_door_opened": "1", - "Alarm_preheating_ready": "0", - "Alarm_program_done": "1", - "Alarm_program_pause": "1", - "Alarm_remote_start_canceled": "1", - "Alarm_rinse_aid_refill": "1", - "Alarm_run_selfcleaning": "1", - "Alarm_salt_refill": "1", - "Auto_dose_duration": "244", - "Auto_dose_quantity_setting_status": "3", - "Auto_dose_refill": "1", - "Auto_dose_setting_status": "2", - "Child_lock": "1", - "Child_lock_setting_status": "1", - "Curent_program_duration": "131", - "Curent_program_remaining_time": "86", - "Current_program_phase": "7", - "Delay_start": "1", - "Delay_start_remaining_time": "0", - "Delay_start_set_time": "0", - "Demo_mode_status": "0", - "Device_status": "2", - "Display_Brightness_setting_status": "255", - "Display_contrast_setting_status": "3", - "Display_logotype_setting_status": "2", - "Door_status": "1", - "Energy_consumption_in_running_program": "65535", - "Energy_save_setting_status": "0", - "Error_F70": "3", - "Error_F76": "1", - "Error_f10": "1", - "Error_f11": "1", - "Error_f12": "1", - "Error_f40": "1", - "Error_f41": "1", - "Error_f42": "1", - "Error_f43": "1", - "Error_f44": "1", - "Error_f45": "1", - "Error_f46": "1", - "Error_f52": "1", - "Error_f54": "1", - "Error_f56": "1", - "Error_f61": "1", - "Error_f62": "1", - "Error_f65": "1", - "Error_f67": "1", - "Error_f68": "1", - "Error_f69": "1", - "Error_f72": "1", - "Error_f74": "1", - "Error_f75": "1", - "Error_read_out_1_code": "12", - "Error_read_out_1_cycle": "475", - "Error_read_out_1_status": "1", - "Error_read_out_2_code": "68", - "Error_read_out_2_cycle": "436", - "Error_read_out_2_status": "1", - "Error_read_out_3_code": "65", - "Error_read_out_3_cycle": "0", - "Error_read_out_3_status": "2", - "FOTA_status": "1", - "Fan_sequence_setting_status": "2", - "Feedback_volumen_setting_status": "3", - "Fill_salt": "1", - "HardPairingStatus": "0", - "Heat_pump_setting_status": "0", - "High_temperature_status": "0", - "Interior_light_at_power_off_setting_status": "2", - "Interior_light_status": "1", - "Language_status": "4", - "Last_run_program_id": "255", - "MDO_on_demand": "0", - "MDO_on_demand_allowed": "0", - "Notification_volumen_setting_status": "3", - "Odor_control_setting": "1", - "Pressure_calibration_setting_status": "11", - "Remote_control_monitoring_set_commands": "2", - "Remote_control_monitoring_set_commands_actions": "1", - "Rinse_aid_refill": "1", - "Rinse_aid_setting_status": "3", - "Sani_Lock": "3", - "Sani_Lock_allowed": "3", - "Selected_program_Lower_wash_function": "0", - "Selected_program_Upper_wash_function": "0", - "Selected_program_auto_door_open_function": "2", - "Selected_program_dry_function": "0", - "Selected_program_extra_drying_function": "0", - "Selected_program_id_status": "1", - "Selected_program_mode": "2", - "Selected_program_storage_function": "0", - "Selected_program_uv_function": "0", - "Session_pairing_active": "0", - "Session_pairing_confirmation": "0", - "Session_pairing_status": "0", - "Silence_on_demand": "0", - "Silence_on_demand_allowed": "0", - "Soft_pairing_status": "0", - "Speed_on_demand": "1", - "Spend_on_demand_allowed": "3", - "Storage_mode_allowed": "1", - "Storage_mode_on_demand_stat": "0", - "Super_rinse_on_demand": "0", - "Super_rinse_on_demand_allowed": "0", - "Super_rinse_setting_status": "1", - "Super_rinse_status": "0", - "Tab_setting_status": "1", - "Temperature_unit_status": "1", - "Time_program_set_duration_status": "0", - "Total_energy_consumption": "443", - "Total_number_of_cycles": "483", - "Total_run_time": "1101", - "Total_water_consumption": "5362", - "UV_mode_on_demand": "2", - "UV_mode_on_demand_allowed": "3", - "Water_consumption_in_running_program": "65535", - "Water_hardness_setting_status": "1", - "Water_inlet_setting_status": "0", - "Water_save_setting_status": "0", - "Water_tank": "0", - "daily_energy_kwh": 0 - }, - "useTime": 1690885767539, - "wifiId": "" - } -] +{ + "bindTime": 1668542674215, + "createTime": 0, + "deviceFeatureCode": "000", + "deviceFeatureName": "W-DW50/60-22", + "deviceId": "", + "deviceNickName": "Oppvaskmaskin", + "deviceTypeCode": "015", + "deviceTypeName": "", + "offlineState": 1, + "puid": "", + "role": 1, + "roomId": 1044366, + "roomName": "Kj\u00f8kken", + "seq": 0, + "statusList": { + "ADO_allowed": "1", + "Alarm_auto_dose_refill": "1", + "Alarm_clean_the_filters": "1", + "Alarm_door_closed": "1", + "Alarm_door_opened": "1", + "Alarm_preheating_ready": "0", + "Alarm_program_done": "1", + "Alarm_program_pause": "1", + "Alarm_remote_start_canceled": "1", + "Alarm_rinse_aid_refill": "1", + "Alarm_run_selfcleaning": "1", + "Alarm_salt_refill": "1", + "Auto_dose_duration": "244", + "Auto_dose_quantity_setting_status": "3", + "Auto_dose_refill": "1", + "Auto_dose_setting_status": "2", + "Child_lock": "1", + "Child_lock_setting_status": "1", + "Curent_program_duration": "131", + "Curent_program_remaining_time": "86", + "Current_program_phase": "7", + "Delay_start": "1", + "Delay_start_remaining_time": "0", + "Delay_start_set_time": "0", + "Demo_mode_status": "0", + "Device_status": "2", + "Display_Brightness_setting_status": "255", + "Display_contrast_setting_status": "3", + "Display_logotype_setting_status": "2", + "Door_status": "1", + "Energy_consumption_in_running_program": "65535", + "Energy_save_setting_status": "0", + "Error_F70": "3", + "Error_F76": "1", + "Error_f10": "1", + "Error_f11": "1", + "Error_f12": "1", + "Error_f40": "1", + "Error_f41": "1", + "Error_f42": "1", + "Error_f43": "1", + "Error_f44": "1", + "Error_f45": "1", + "Error_f46": "1", + "Error_f52": "1", + "Error_f54": "1", + "Error_f56": "1", + "Error_f61": "1", + "Error_f62": "1", + "Error_f65": "1", + "Error_f67": "1", + "Error_f68": "1", + "Error_f69": "1", + "Error_f72": "1", + "Error_f74": "1", + "Error_f75": "1", + "Error_read_out_1_code": "12", + "Error_read_out_1_cycle": "475", + "Error_read_out_1_status": "1", + "Error_read_out_2_code": "68", + "Error_read_out_2_cycle": "436", + "Error_read_out_2_status": "1", + "Error_read_out_3_code": "65", + "Error_read_out_3_cycle": "0", + "Error_read_out_3_status": "2", + "FOTA_status": "1", + "Fan_sequence_setting_status": "2", + "Feedback_volumen_setting_status": "3", + "Fill_salt": "1", + "HardPairingStatus": "0", + "Heat_pump_setting_status": "0", + "High_temperature_status": "0", + "Interior_light_at_power_off_setting_status": "2", + "Interior_light_status": "1", + "Language_status": "4", + "Last_run_program_id": "255", + "MDO_on_demand": "0", + "MDO_on_demand_allowed": "0", + "Notification_volumen_setting_status": "3", + "Odor_control_setting": "1", + "Pressure_calibration_setting_status": "11", + "Remote_control_monitoring_set_commands": "2", + "Remote_control_monitoring_set_commands_actions": "1", + "Rinse_aid_refill": "1", + "Rinse_aid_setting_status": "3", + "Sani_Lock": "3", + "Sani_Lock_allowed": "3", + "Selected_program_Lower_wash_function": "0", + "Selected_program_Upper_wash_function": "0", + "Selected_program_auto_door_open_function": "2", + "Selected_program_dry_function": "0", + "Selected_program_extra_drying_function": "0", + "Selected_program_id_status": "1", + "Selected_program_mode": "2", + "Selected_program_storage_function": "0", + "Selected_program_uv_function": "0", + "Session_pairing_active": "0", + "Session_pairing_confirmation": "0", + "Session_pairing_status": "0", + "Silence_on_demand": "0", + "Silence_on_demand_allowed": "0", + "Soft_pairing_status": "0", + "Speed_on_demand": "1", + "Spend_on_demand_allowed": "3", + "Storage_mode_allowed": "1", + "Storage_mode_on_demand_stat": "0", + "Super_rinse_on_demand": "0", + "Super_rinse_on_demand_allowed": "0", + "Super_rinse_setting_status": "1", + "Super_rinse_status": "0", + "Tab_setting_status": "1", + "Temperature_unit_status": "1", + "Time_program_set_duration_status": "0", + "Total_energy_consumption": "443", + "Total_number_of_cycles": "483", + "Total_run_time": "1101", + "Total_water_consumption": "5362", + "UV_mode_on_demand": "2", + "UV_mode_on_demand_allowed": "3", + "Water_consumption_in_running_program": "65535", + "Water_hardness_setting_status": "1", + "Water_inlet_setting_status": "0", + "Water_save_setting_status": "0", + "Water_tank": "0", + "daily_energy_kwh": 0 + }, + "useTime": 1690885767539, + "wifiId": "" +} diff --git a/dumps/Asko_induction_hob_2.json b/dumps/Asko_induction_hob_2.json index 7220300..dfbc14d 100644 --- a/dumps/Asko_induction_hob_2.json +++ b/dumps/Asko_induction_hob_2.json @@ -1 +1,120 @@ -{"wifiId":"","deviceId":"","puid":"","deviceNickName":"Atag hob","deviceFeatureCode":"63c45b513e1a4bf7","deviceFeatureName":"HOB","deviceTypeCode":"020","deviceTypeName":"","bindTime":1629723678408,"role":1,"roomId":142500,"roomName":"AR kitchen","statusList":{"Device_status":"8018","Zone_number":"5","Child_lock":"8131","Total_time_of_cooking_in_hours":"491","ECO_mode":"8202","SL1_Bridge_function_active":"0","SL2_Bridge_function_active":"0","SL3_Bridge_function_active":"0","SL4_Bridge_function_active":"0","SL5_Bridge_function_active":"0","SL6_Bridge_function_active":"0","Alarm_NTC_power":"0","Alarm_NTC_TC":"0","Alarm_voltage":"0","Alarm_Hob_Hood_Started":"0","Alarm_NTC_coil_overheating":"0","Alarm_zone_turned_off":"0","Alarm_timer_ended":"0","Alarm_auto_program_notification":"0","Alarm_automatic_switch_off_zone":"0","SL1_Alarm_NTC_coil_overheating":"0","SL1_Alarm_zone_turned_off":"0","SL1_Alarm_timer_ended":"0","SL1_Alarm_auto_program_notification":"0","SL1_Alarm_automatic_switch_off_zone":"0","SL2_Alarm_NTC_coil_overheating":"0","SL2_Alarm_zone_turned_off":"0","SL2_Alarm_timer_ended":"0","SL2_Alarm_auto_program_notification":"0","SL2_Alarm_automatic_switch_off_zone":"0","SL3_Alarm_NTC_coil_overheating":"0","SL3_Alarm_zone_turned_off":"0","SL3_Alarm_timer_ended":"0","SL3_Alarm_auto_program_notification":"0","SL3_Alarm_automatic_switch_off_zone":"0","SL4_Alarm_NTC_coil_overheating":"0","SL4_Alarm_zone_turned_off":"0","SL4_Alarm_timer_ended":"0","SL4_Alarm_auto_program_notification":"0","SL4_Alarm_automatic_switch_off_zone":"0","SL5_Alarm_NTC_coil_overheating":"0","SL5_Alarm_zone_turned_off":"0","SL5_Alarm_timer_ended":"0","SL5_Alarm_auto_program_notification":"0","SL5_Alarm_automatic_switch_off_zone":"0","SL6_Alarm_NTC_coil_overheating":"0","SL6_Alarm_zone_turned_off":"0","SL6_Alarm_timer_ended":"0","SL6_Alarm_auto_program_notification":"0","SL6_Alarm_automatic_switch_off_zone":"0","SL":"6","SL1_Power_level":"0","SL1_Status":"0","SL1_Active_timer":"0","SL1_NTC_sensor":"0","SL1_Pot_detected":"8127","SL1_Functions":"8166","SL1_Power_level_max":"13","SL1_Zone_shape":"8344","SL2_Power_level":"0","SL2_Status":"0","SL2_Active_timer":"0","SL2_NTC_sensor":"0","SL2_Pot_detected":"8127","SL2_Functions":"8166","SL2_Power_level_max":"13","SL2_Zone_shape":"8344","SL3_Power_level":"0","SL3_Status":"0","SL3_Active_timer":"0","SL3_NTC_sensor":"0","SL3_Pot_detected":"8127","SL3_Functions":"8166","SL3_Power_level_max":"13","SL3_Zone_shape":"8341","SL4_Power_level":"0","SL4_Status":"0","SL4_Active_timer":"0","SL4_NTC_sensor":"0","SL4_Pot_detected":"8127","SL4_Functions":"8166","SL4_Power_level_max":"13","SL4_Zone_shape":"8344","SL5_Power_level":"0","SL5_Status":"0","SL5_Active_timer":"0","SL5_NTC_sensor":"0","SL5_Pot_detected":"8127","SL5_Functions":"8166","SL5_Power_level_max":"13","SL5_Zone_shape":"8344","SL6_Power_level":"0","SL6_Status":"0","SL6_Active_timer":"0","SL6_NTC_sensor":"0","SL6_Pot_detected":"8127","SL6_Functions":"8166","SL6_Power_level_max":"13","SL6_Zone_shape":"8345","daily_energy_kwh":0},"useTime":0,"offlineState":1,"seq":0,"createTime":0} +{ + "wifiId": "", + "deviceId": "", + "puid": "", + "deviceNickName": "Atag hob", + "deviceFeatureCode": "63c45b513e1a4bf7", + "deviceFeatureName": "HOB", + "deviceTypeCode": "020", + "deviceTypeName": "", + "bindTime": 1629723678408, + "role": 1, + "roomId": 142500, + "roomName": "AR kitchen", + "statusList": { + "Device_status": "8018", + "Zone_number": "5", + "Child_lock": "8131", + "Total_time_of_cooking_in_hours": "491", + "ECO_mode": "8202", + "SL1_Bridge_function_active": "0", + "SL2_Bridge_function_active": "0", + "SL3_Bridge_function_active": "0", + "SL4_Bridge_function_active": "0", + "SL5_Bridge_function_active": "0", + "SL6_Bridge_function_active": "0", + "Alarm_NTC_power": "0", + "Alarm_NTC_TC": "0", + "Alarm_voltage": "0", + "Alarm_Hob_Hood_Started": "0", + "Alarm_NTC_coil_overheating": "0", + "Alarm_zone_turned_off": "0", + "Alarm_timer_ended": "0", + "Alarm_auto_program_notification": "0", + "Alarm_automatic_switch_off_zone": "0", + "SL1_Alarm_NTC_coil_overheating": "0", + "SL1_Alarm_zone_turned_off": "0", + "SL1_Alarm_timer_ended": "0", + "SL1_Alarm_auto_program_notification": "0", + "SL1_Alarm_automatic_switch_off_zone": "0", + "SL2_Alarm_NTC_coil_overheating": "0", + "SL2_Alarm_zone_turned_off": "0", + "SL2_Alarm_timer_ended": "0", + "SL2_Alarm_auto_program_notification": "0", + "SL2_Alarm_automatic_switch_off_zone": "0", + "SL3_Alarm_NTC_coil_overheating": "0", + "SL3_Alarm_zone_turned_off": "0", + "SL3_Alarm_timer_ended": "0", + "SL3_Alarm_auto_program_notification": "0", + "SL3_Alarm_automatic_switch_off_zone": "0", + "SL4_Alarm_NTC_coil_overheating": "0", + "SL4_Alarm_zone_turned_off": "0", + "SL4_Alarm_timer_ended": "0", + "SL4_Alarm_auto_program_notification": "0", + "SL4_Alarm_automatic_switch_off_zone": "0", + "SL5_Alarm_NTC_coil_overheating": "0", + "SL5_Alarm_zone_turned_off": "0", + "SL5_Alarm_timer_ended": "0", + "SL5_Alarm_auto_program_notification": "0", + "SL5_Alarm_automatic_switch_off_zone": "0", + "SL6_Alarm_NTC_coil_overheating": "0", + "SL6_Alarm_zone_turned_off": "0", + "SL6_Alarm_timer_ended": "0", + "SL6_Alarm_auto_program_notification": "0", + "SL6_Alarm_automatic_switch_off_zone": "0", + "SL": "6", + "SL1_Power_level": "0", + "SL1_Status": "0", + "SL1_Active_timer": "0", + "SL1_NTC_sensor": "0", + "SL1_Pot_detected": "8127", + "SL1_Functions": "8166", + "SL1_Power_level_max": "13", + "SL1_Zone_shape": "8344", + "SL2_Power_level": "0", + "SL2_Status": "0", + "SL2_Active_timer": "0", + "SL2_NTC_sensor": "0", + "SL2_Pot_detected": "8127", + "SL2_Functions": "8166", + "SL2_Power_level_max": "13", + "SL2_Zone_shape": "8344", + "SL3_Power_level": "0", + "SL3_Status": "0", + "SL3_Active_timer": "0", + "SL3_NTC_sensor": "0", + "SL3_Pot_detected": "8127", + "SL3_Functions": "8166", + "SL3_Power_level_max": "13", + "SL3_Zone_shape": "8341", + "SL4_Power_level": "0", + "SL4_Status": "0", + "SL4_Active_timer": "0", + "SL4_NTC_sensor": "0", + "SL4_Pot_detected": "8127", + "SL4_Functions": "8166", + "SL4_Power_level_max": "13", + "SL4_Zone_shape": "8344", + "SL5_Power_level": "0", + "SL5_Status": "0", + "SL5_Active_timer": "0", + "SL5_NTC_sensor": "0", + "SL5_Pot_detected": "8127", + "SL5_Functions": "8166", + "SL5_Power_level_max": "13", + "SL5_Zone_shape": "8344", + "SL6_Power_level": "0", + "SL6_Status": "0", + "SL6_Active_timer": "0", + "SL6_NTC_sensor": "0", + "SL6_Pot_detected": "8127", + "SL6_Functions": "8166", + "SL6_Power_level_max": "13", + "SL6_Zone_shape": "8345", + "daily_energy_kwh": 0 + }, + "useTime": 0, + "offlineState": 1, + "seq": 0, + "createTime": 0 +} diff --git a/dumps/Gorenje_dishwasher.json b/dumps/Gorenje_dishwasher.json index a982f8d..fa4fdd0 100644 --- a/dumps/Gorenje_dishwasher.json +++ b/dumps/Gorenje_dishwasher.json @@ -1,147 +1,145 @@ -[ - { - "wifiId": "", - "deviceId": "", - "puid": "", - "deviceNickName": "Dishwasher", - "deviceFeatureCode": "000", - "deviceFeatureName": "W-DW50\/60-22", - "deviceTypeCode": "015", - "deviceTypeName": "", - "bindTime": 1710363016042, - "role": 1, - "roomId": 3813850, - "roomName": "default_room", - "statusList": { - "ADO_allowed": "0", - "Alarm_auto_dose_refill": "0", - "Alarm_clean_the_filters": "1", - "Alarm_door_closed": "1", - "Alarm_door_opened": "1", - "Alarm_preheating_ready": "0", - "Alarm_program_done": "1", - "Alarm_program_pause": "1", - "Alarm_remote_start_canceled": "1", - "Alarm_rinse_aid_refill": "1", - "Alarm_run_selfcleaning": "1", - "Alarm_salt_refill": "1", - "Auto_dose_duration": "244", - "Auto_dose_quantity_setting_status": "1", - "Auto_dose_refill": "1", - "Auto_dose_setting_status": "1", - "Child_lock": "0", - "Child_lock_setting_status": "0", - "Curent_program_duration": "200", - "Curent_program_remaining_time": "65535", - "Current_program_phase": "1", - "Delay_start": "1", - "Delay_start_remaining_time": "0", - "Delay_start_set_time": "0", - "Demo_mode_status": "0", - "Device_status": "1", - "Display_Brightness_setting_status": "255", - "Display_contrast_setting_status": "0", - "Display_logotype_setting_status": "0", - "Door_status": "2", - "Energy_consumption_in_running_program": "65535", - "Energy_save_setting_status": "0", - "Error_F70": "2", - "Error_F76": "2", - "Error_f10": "1", - "Error_f11": "1", - "Error_f12": "1", - "Error_f40": "1", - "Error_f41": "1", - "Error_f42": "1", - "Error_f43": "1", - "Error_f44": "1", - "Error_f45": "1", - "Error_f46": "1", - "Error_f52": "1", - "Error_f54": "1", - "Error_f56": "1", - "Error_f61": "1", - "Error_f62": "1", - "Error_f65": "1", - "Error_f67": "1", - "Error_f68": "1", - "Error_f69": "1", - "Error_f72": "1", - "Error_f74": "1", - "Error_f75": "1", - "Error_read_out_1_code": "255", - "Error_read_out_1_cycle": "65535", - "Error_read_out_1_status": "0", - "Error_read_out_2_code": "255", - "Error_read_out_2_cycle": "65535", - "Error_read_out_2_status": "0", - "Error_read_out_3_code": "255", - "Error_read_out_3_cycle": "65535", - "Error_read_out_3_status": "0", - "FOTA_status": "5", - "Fan_sequence_setting_status": "2", - "Feedback_volumen_setting_status": "3", - "Fill_salt": "2", - "HardPairingStatus": "0", - "Heat_pump_setting_status": "0", - "High_temperature_status": "0", - "Interior_light_at_power_off_setting_status": "2", - "Interior_light_status": "1", - "Language_status": "0", - "Last_run_program_id": "255", - "MDO_on_demand": "0", - "MDO_on_demand_allowed": "0", - "Notification_volumen_setting_status": "0", - "Odor_control_setting": "0", - "Pressure_calibration_setting_status": "16", - "Remote_control_monitoring_set_commands": "2", - "Remote_control_monitoring_set_commands_actions": "1", - "Rinse_aid_refill": "2", - "Rinse_aid_setting_status": "6", - "Sani_Lock": "3", - "Sani_Lock_allowed": "3", - "Selected_program_Lower_wash_function": "0", - "Selected_program_Upper_wash_function": "0", - "Selected_program_auto_door_open_function": "2", - "Selected_program_dry_function": "0", - "Selected_program_extra_drying_function": "0", - "Selected_program_id_status": "1", - "Selected_program_mode": "2", - "Selected_program_storage_function": "0", - "Selected_program_uv_function": "0", - "Session_pairing_active": "0", - "Session_pairing_confirmation": "0", - "Session_pairing_status": "0", - "Silence_on_demand": "0", - "Silence_on_demand_allowed": "0", - "Soft_pairing_status": "0", - "Speed_on_demand": "1", - "Spend_on_demand_allowed": "2", - "Storage_mode_allowed": "2", - "Storage_mode_on_demand_stat": "0", - "Super_rinse_on_demand": "0", - "Super_rinse_on_demand_allowed": "0", - "Super_rinse_setting_status": "0", - "Super_rinse_status": "0", - "Tab_setting_status": "1", - "Temperature_unit_status": "0", - "Time_program_set_duration_status": "0", - "Total_energy_consumption": "0", - "Total_number_of_cycles": "0", - "Total_run_time": "0", - "Total_water_consumption": "0", - "UV_mode_on_demand": "2", - "UV_mode_on_demand_allowed": "3", - "Water_consumption_in_running_program": "65535", - "Water_hardness_setting_status": "5", - "Water_inlet_setting_status": "0", - "Water_save_setting_status": "0", - "Water_tank": "0", - "daily_energy_kwh": 0 - }, - "useTime": 1710363016020, - "offlineState": 1, - "seq": 0, - "createTime": 0 - } -] +{ + "wifiId": "", + "deviceId": "", + "puid": "", + "deviceNickName": "Dishwasher", + "deviceFeatureCode": "000", + "deviceFeatureName": "W-DW50\/60-22", + "deviceTypeCode": "015", + "deviceTypeName": "", + "bindTime": 1710363016042, + "role": 1, + "roomId": 3813850, + "roomName": "default_room", + "statusList": { + "ADO_allowed": "0", + "Alarm_auto_dose_refill": "0", + "Alarm_clean_the_filters": "1", + "Alarm_door_closed": "1", + "Alarm_door_opened": "1", + "Alarm_preheating_ready": "0", + "Alarm_program_done": "1", + "Alarm_program_pause": "1", + "Alarm_remote_start_canceled": "1", + "Alarm_rinse_aid_refill": "1", + "Alarm_run_selfcleaning": "1", + "Alarm_salt_refill": "1", + "Auto_dose_duration": "244", + "Auto_dose_quantity_setting_status": "1", + "Auto_dose_refill": "1", + "Auto_dose_setting_status": "1", + "Child_lock": "0", + "Child_lock_setting_status": "0", + "Curent_program_duration": "200", + "Curent_program_remaining_time": "65535", + "Current_program_phase": "1", + "Delay_start": "1", + "Delay_start_remaining_time": "0", + "Delay_start_set_time": "0", + "Demo_mode_status": "0", + "Device_status": "1", + "Display_Brightness_setting_status": "255", + "Display_contrast_setting_status": "0", + "Display_logotype_setting_status": "0", + "Door_status": "2", + "Energy_consumption_in_running_program": "65535", + "Energy_save_setting_status": "0", + "Error_F70": "2", + "Error_F76": "2", + "Error_f10": "1", + "Error_f11": "1", + "Error_f12": "1", + "Error_f40": "1", + "Error_f41": "1", + "Error_f42": "1", + "Error_f43": "1", + "Error_f44": "1", + "Error_f45": "1", + "Error_f46": "1", + "Error_f52": "1", + "Error_f54": "1", + "Error_f56": "1", + "Error_f61": "1", + "Error_f62": "1", + "Error_f65": "1", + "Error_f67": "1", + "Error_f68": "1", + "Error_f69": "1", + "Error_f72": "1", + "Error_f74": "1", + "Error_f75": "1", + "Error_read_out_1_code": "255", + "Error_read_out_1_cycle": "65535", + "Error_read_out_1_status": "0", + "Error_read_out_2_code": "255", + "Error_read_out_2_cycle": "65535", + "Error_read_out_2_status": "0", + "Error_read_out_3_code": "255", + "Error_read_out_3_cycle": "65535", + "Error_read_out_3_status": "0", + "FOTA_status": "5", + "Fan_sequence_setting_status": "2", + "Feedback_volumen_setting_status": "3", + "Fill_salt": "2", + "HardPairingStatus": "0", + "Heat_pump_setting_status": "0", + "High_temperature_status": "0", + "Interior_light_at_power_off_setting_status": "2", + "Interior_light_status": "1", + "Language_status": "0", + "Last_run_program_id": "255", + "MDO_on_demand": "0", + "MDO_on_demand_allowed": "0", + "Notification_volumen_setting_status": "0", + "Odor_control_setting": "0", + "Pressure_calibration_setting_status": "16", + "Remote_control_monitoring_set_commands": "2", + "Remote_control_monitoring_set_commands_actions": "1", + "Rinse_aid_refill": "2", + "Rinse_aid_setting_status": "6", + "Sani_Lock": "3", + "Sani_Lock_allowed": "3", + "Selected_program_Lower_wash_function": "0", + "Selected_program_Upper_wash_function": "0", + "Selected_program_auto_door_open_function": "2", + "Selected_program_dry_function": "0", + "Selected_program_extra_drying_function": "0", + "Selected_program_id_status": "1", + "Selected_program_mode": "2", + "Selected_program_storage_function": "0", + "Selected_program_uv_function": "0", + "Session_pairing_active": "0", + "Session_pairing_confirmation": "0", + "Session_pairing_status": "0", + "Silence_on_demand": "0", + "Silence_on_demand_allowed": "0", + "Soft_pairing_status": "0", + "Speed_on_demand": "1", + "Spend_on_demand_allowed": "2", + "Storage_mode_allowed": "2", + "Storage_mode_on_demand_stat": "0", + "Super_rinse_on_demand": "0", + "Super_rinse_on_demand_allowed": "0", + "Super_rinse_setting_status": "0", + "Super_rinse_status": "0", + "Tab_setting_status": "1", + "Temperature_unit_status": "0", + "Time_program_set_duration_status": "0", + "Total_energy_consumption": "0", + "Total_number_of_cycles": "0", + "Total_run_time": "0", + "Total_water_consumption": "0", + "UV_mode_on_demand": "2", + "UV_mode_on_demand_allowed": "3", + "Water_consumption_in_running_program": "65535", + "Water_hardness_setting_status": "5", + "Water_inlet_setting_status": "0", + "Water_save_setting_status": "0", + "Water_tank": "0", + "daily_energy_kwh": 0 + }, + "useTime": 1710363016020, + "offlineState": 1, + "seq": 0, + "createTime": 0 +} diff --git a/dumps/Heat_pump.json b/dumps/Heat_pump.json index b12c4c7..2052043 100644 --- a/dumps/Heat_pump.json +++ b/dumps/Heat_pump.json @@ -1,4 +1,4 @@ -[ + { "wifiId": "", "deviceId": "", @@ -57,4 +57,3 @@ "seq": 0, "createTime": 0 } -] diff --git a/dumps/airCondDumpHisense.json b/dumps/airCondDumpHisense.json index 868a17b..bba1c09 100644 --- a/dumps/airCondDumpHisense.json +++ b/dumps/airCondDumpHisense.json @@ -1,70 +1,68 @@ -[ - { - "bindTime": 1715959596828, - "createTime": 0, - "deviceFeatureCode": "104", - "deviceFeatureName": "104\u51b7\u6696\u8282\u80fd\u65e0\u529f\u7387", - "deviceId": "", - "deviceNickName": "Klimatyzator", - "deviceTypeCode": "009", - "deviceTypeName": "", - "offlineState": 1, - "puid": "", - "role": 1, - "roomId": 4349167, - "roomName": "Living Room", - "seq": 0, - "statusList": { - "daily_energy_kwh": 0, - "f-filter": "0", - "f_e_arkgrille": "0", - "f_e_dwmachine": "0", - "f_e_incoiltemp": "0", - "f_e_incom": "0", - "f_e_indisplay": "0", - "f_e_ineeprom": "0", - "f_e_inele": "0", - "f_e_infanmotor": "0", - "f_e_inhumidity": "0", - "f_e_inkeys": "0", - "f_e_intemp": "0", - "f_e_invzero": "0", - "f_e_inwifi": "0", - "f_e_outcoiltemp": "0", - "f_e_outeeprom": "0", - "f_e_outgastemp": "0", - "f_e_outtemp": "0", - "f_e_over_cold": "0", - "f_e_over_hot": "0", - "f_e_push": "0", - "f_e_upmachine": "0", - "f_e_waterfull": "0", - "f_electricity": "0", - "f_humidity": "128", - "f_temp_in": "26", - "f_votage": "228", - "t_dal": "1", - "t_demand_response": "0", - "t_eco": "0", - "t_fan_mute": "0", - "t_fan_speed": "0", - "t_fan_speed_s": "0", - "t_fanspeedcv": "0", - "t_power": "1", - "t_sleep": "0", - "t_super": "0", - "t_swing_angle": "0", - "t_swing_direction": "5", - "t_swing_follow": "3", - "t_talr": "1", - "t_temp": "23", - "t_temp_compensate": "7", - "t_temp_type": "0", - "t_tms": "1", - "t_up_down": "0", - "t_work_mode": "2" - }, - "useTime": 1715959596807, - "wifiId": "" - } -] \ No newline at end of file +{ + "bindTime": 1715959596828, + "createTime": 0, + "deviceFeatureCode": "104", + "deviceFeatureName": "104\u51b7\u6696\u8282\u80fd\u65e0\u529f\u7387", + "deviceId": "", + "deviceNickName": "Klimatyzator", + "deviceTypeCode": "009", + "deviceTypeName": "", + "offlineState": 1, + "puid": "", + "role": 1, + "roomId": 4349167, + "roomName": "Living Room", + "seq": 0, + "statusList": { + "daily_energy_kwh": 0, + "f-filter": "0", + "f_e_arkgrille": "0", + "f_e_dwmachine": "0", + "f_e_incoiltemp": "0", + "f_e_incom": "0", + "f_e_indisplay": "0", + "f_e_ineeprom": "0", + "f_e_inele": "0", + "f_e_infanmotor": "0", + "f_e_inhumidity": "0", + "f_e_inkeys": "0", + "f_e_intemp": "0", + "f_e_invzero": "0", + "f_e_inwifi": "0", + "f_e_outcoiltemp": "0", + "f_e_outeeprom": "0", + "f_e_outgastemp": "0", + "f_e_outtemp": "0", + "f_e_over_cold": "0", + "f_e_over_hot": "0", + "f_e_push": "0", + "f_e_upmachine": "0", + "f_e_waterfull": "0", + "f_electricity": "0", + "f_humidity": "128", + "f_temp_in": "26", + "f_votage": "228", + "t_dal": "1", + "t_demand_response": "0", + "t_eco": "0", + "t_fan_mute": "0", + "t_fan_speed": "0", + "t_fan_speed_s": "0", + "t_fanspeedcv": "0", + "t_power": "1", + "t_sleep": "0", + "t_super": "0", + "t_swing_angle": "0", + "t_swing_direction": "5", + "t_swing_follow": "3", + "t_talr": "1", + "t_temp": "23", + "t_temp_compensate": "7", + "t_temp_type": "0", + "t_tms": "1", + "t_up_down": "0", + "t_work_mode": "2" + }, + "useTime": 1715959596807, + "wifiId": "" +} diff --git a/dumps/hisenserefrigeratordump.json b/dumps/hisenserefrigeratordump.json index 53698cf..8b5dcf2 100644 --- a/dumps/hisenserefrigeratordump.json +++ b/dumps/hisenserefrigeratordump.json @@ -1,327 +1,325 @@ -[ - { - "bindTime": 1710171538374, - "createTime": 0, - "deviceFeatureCode": "1b0610z0049j", - "deviceFeatureName": "BCD-610WP1BWF1S3/HC4(HAB)", - "deviceId": "", - "deviceNickName": "Refrigerator", - "deviceTypeCode": "026", - "deviceTypeName": "", - "offlineState": 1, - "puid": "", - "role": 1, - "roomId": 3836987, - "roomName": "default_room", - "seq": 0, - "statusList": { - "AIR_FRESHNESS": "0", - "ODOR_SENSOR_FAULT_FLAG": "0", - "ODOR_SENSOR_NO_DISTURB_MODE_STATUS": "1", - "ODOR_SENSOR_SENSITIVITY": "3", - "ODOR_SENSOR_SWITHC_STATUS": "1", - "STERI_PURI_CYCLE_FLAG": "1", - "ai_energy_mode_switch": "0", - "alarm_key": "0", - "alarm_sound_volume": "0", - "ali_wifi_fault_flag": "0", - "automatic_ice_making": "1", - "camera_state": "0", - "charcoal_filter_expiration_alarm": "0", - "charcoal_filter_surplus_time": "0", - "charcoal_filter_time_reset": "0", - "child_lock_open_alarm": "0", - "child_lock_open_door_sound_alarm": "0", - "child_lock_switch_exist": "0", - "child_lock_switch_status": "0", - "commodity_inspection": "0", - "compressor_condition": "0", - "compressor_frequency": "0", - "condensation_fan_failure_status": "0", - "control_failure_status": "0", - "custard_room": "36", - "daily_energy_kwh": 0, - "date_display_format_status": "0", - "date_format_status": "0", - "date_time_format_day_state": "0", - "date_time_format_month_state": "0", - "date_time_format_year_state": "0", - "dbd_clean_mode": "0", - "debacilli_mode": "0", - "display_panel_ronshen": "1", - "displayboard_brand": "3", - "displayboard_key_setting": "0", - "displayboard_type": "75", - "displayboard_version": "1", - "door_close_light_status": "0", - "door_close_ui_display_status": "0", - "door_num_four_color": "0", - "door_num_one_color": "0", - "door_num_three_color": "0", - "door_num_two_color": "0", - "door_open_light_status": "0", - "door_open_ui_display_status": "0", - "electric_current": "111", - "electric_energy_one_tenths_value": "0", - "electric_energy_percentile_thousands_value": "5", - "envi_temp_sens_head_failure": "0", - "environment_humidity": "55", - "environment_real_temperature": "30", - "existing_fuzzy_mode": "0", - "existing_holiday_mode": "0", - "existing_lock_fresh_mode": "0", - "existing_save_mode": "1", - "existing_sf_mode": "1", - "existing_sr_mode": "1", - "fast_store_mode_exist": "0", - "fast_store_mode_status": "0", - "filter_alarm_time": "0", - "filter_state": "45", - "free_defrosting_failure": "0", - "free_evap_temp_sens_head_failure": "0", - "free_fan_failure": "0", - "free_key": "0", - "free_room": "1", - "free_room_open": "0", - "free_room_open_2": "0", - "free_room_over_temp_alarm_failure": "0", - "free_temp_sens_head_failure": "0", - "freeze_door_open_time": "0", - "freeze_max_temperature": "-13", - "freeze_min_temperature": "-24", - "freeze_poweroff_ad": "0", - "freeze_poweron_ad": "0", - "freeze_real_temperature": "-20", - "freeze_sensor_real_temperature": "-40", - "freeze_temperature": "-18", - "frost_state": "0", - "froze_convert_to_refri_switch_status": "0", - "fruit_vegetables_temperature": "0", - "fuzzy_mode": "0", - "gold_water_supply_mode": "0", - "high_humidity": "0", - "high_temperature": "0", - "holiday_mode": "0", - "human_on_off_status": "0", - "human_sense_light_status": "0", - "human_sense_ui_display_state": "0", - "human_sensor_switch_exist": "0", - "humdy_test_switch_state": "0", - "humidity sensor_failure": "0", - "ice_making_b_switch_status": "0", - "ice_making_full_status": "0", - "ice_making_machine_failure": "0", - "ice_making_state": "1", - "ice_sensor_failure_flag": "0", - "ice_temperature_sensor_header_failure_flag": "0", - "inlet pipe_temp_sens_head_failure": "0", - "key_press_sound_volume": "0", - "language_select": "0", - "load_operation_status2": "0", - "lock_fresh_mode": "0", - "lock_key": "0", - "low_humidity": "0", - "low_temperature": "0", - "low_wine_area_c_evaporator_fault": "0", - "low_wine_area_c_fan_fault": "0", - "low_wine_area_c_humdy_fault": "0", - "low_wine_area_c_temp_fault": "0", - "lumin_value_of_interior_light": "0", - "mainboard_type": "70", - "mainboard_version": "151", - "market_mode_exist": "0", - "measured_vibrations": "0", - "medium_humidity": "0", - "medium_temperature": "0", - "micro_water_supply_mode": "0", - "mid_wine_area_b_evaporator_fault": "0", - "mid_wine_area_b_fan_fault": "0", - "mid_wine_area_b_humdy_fault": "0", - "mid_wine_area_b_temp_fault": "0", - "mode_key": "0", - "model_type": "26", - "monitor": "0", - "monitor_set": "0", - "monitor_set_act": "0", - "night_mode_end_hour": "0", - "night_mode_end_min": "0", - "night_mode_light_dark_level": "0", - "night_mode_screen_dark_level": "0", - "night_mode_start_hour": "0", - "night_mode_start_min": "0", - "night_mode_status": "0", - "normal_sound_size": "0", - "not_active": "1", - "open_freeze_door_alarm": "0", - "open_refrigerator_door_alarm": "0", - "open_the_door_alarm": "0", - "open_variation_door_alarm": "0", - "pairing": "0", - "pairing_active": "0", - "power_hundred_ten_value": "0", - "power_one_tenths_value": "0", - "power_voltage": "0", - "quiet_mode_status": "0", - "real_humidity": "0", - "real_humidity_b": "0", - "real_humidity_c": "0", - "ref_light": "0", - "refr_defrosting_failure": "0", - "refr_dry_wet_room_sens_failure": "0", - "refr_evap_temp_sens_head_failure": "0", - "refr_fan_failure": "0", - "refr_key": "0", - "refr_room": "1", - "refr_room_open": "0", - "refr_room_over_temp_alarm": "0", - "refr_temp_sens_head_failure": "0", - "refr_var_room_sens_failure": "0", - "refrigerator_door_open_time": "0", - "refrigerator_freeze_swith": "0", - "refrigerator_freeze_swith_state": "0", - "refrigerator_max_temperature": "9", - "refrigerator_min_temperature": "2", - "refrigerator_poweroff_ad": "0", - "refrigerator_poweron_ad": "0", - "refrigerator_real_temperature": "4", - "refrigerator_sensor_real_temperature": "-24", - "refrigerator_temperature": "4", - "reserve45": "0", - "reserve46": "0", - "reserve47": "0", - "reserve48": "0", - "reserve49": "0", - "reserve50": "0", - "reserve51": "0", - "reserve52": "0", - "reserve53": "0", - "reserve54": "0", - "reserve55": "0", - "reserve56": "0", - "reserve57": "0", - "reserve58": "0", - "reserve59": "0", - "reserve60": "0", - "reserve61": "65535", - "reserve62": "65535", - "reserve63": "65535", - "reserve64": "65535", - "reserve65": "65535", - "reserve66": "65535", - "reserve67": "65535", - "reserve68": "65535", - "reserve69": "65535", - "reserve70": "65535", - "reserve71": "65535", - "reserve72": "65535", - "rgb_atmosphere_mode_b_value": "0", - "rgb_atmosphere_mode_g_value": "0", - "rgb_atmosphere_mode_r_value": "0", - "rgb_function_mode_b_value": "0", - "rgb_function_mode_g_value": "0", - "rgb_function_mode_r_value": "0", - "rgb_light_atmosphere_brightness": "0", - "rgb_light_atmosphere_on_time": "0", - "rgb_light_function_brightness": "0", - "rgb_light_function_on_time": "0", - "rgb_light_normal_brightness": "0", - "rgb_light_normal_on_time": "0", - "rgb_light_state": "0", - "rgb_normal_mode_b_value": "0", - "rgb_normal_mode_g_value": "0", - "rgb_normal_mode_r_value": "0", - "right_free_sensor_failure": "0", - "run_status_flag_5": "0", - "running_status": "0", - "running_status3": "0", - "rx_failure": "0", - "sabbath_mode_status": "0", - "sabbath_mode_switch_status": "0", - "save_mode": "0", - "screen_display_brightness": "0", - "screen_display_lock": "0", - "screen_to_clock_time": "0", - "screen_to_standby_time": "0", - "sensor_failure_status": "0", - "sensor_failure_status2": "0", - "sf_mode": "0", - "sf_sr_mutex_mode": "1", - "shelf_light_a_state": "0", - "shelf_light_atmosphere_brightness": "0", - "shelf_light_atmosphere_mode_brightness": "0", - "shelf_light_b_state": "0", - "shelf_light_c_state": "0", - "shelf_light_function_mode_brightness": "0", - "shelf_light_function_on_time": "0", - "shelf_light_normal_on_time": "0", - "show_mode": "0", - "special_space": "0", - "sr_mode": "0", - "standby_mode_state": "0", - "standby_mode_valid": "0", - "super_water_supply_mode": "0", - "temp_auto_ctrl_mode_exist": "0", - "temp_auto_ctrl_mode_state": "0", - "temperature_room_judge": "19", - "temperature_unit": "0", - "theme_color": "0", - "tx_failure": "0", - "unfreeze_run_status": "0", - "unfreeze_switch_status": "0", - "unpair_all_users": "0", - "up_wine_area_a_evaporator_fault": "0", - "up_wine_area_a_fan_fault": "0", - "up_wine_area_a_humdy_fault": "0", - "up_wine_area_a_temp_fault": "0", - "user_debacilli_mode": "0", - "vacuum_on_off_status": "0", - "var_room_open_2": "0", - "var_room_over_temp_alarm": "0", - "vari_evap_temp_sens_head_failure": "0", - "vari_key": "0", - "vari_room": "0", - "vari_room_open": "0", - "vari_temp_sens_head_failure": "0", - "variable_fan_failure_status": "0", - "variable_heater_failure_status": "0", - "variable_temperature_space ": "0", - "variation_door_open_time": "0", - "variation_max_temperature": "5", - "variation_min_temperature": "-20", - "variation_poweroff_ad": "0", - "variation_poweron_ad": "0", - "variation_real_temperature": "-40", - "variation_sensor_real_temperature": "-40", - "variation_temperature": "-40", - "vibration_alarm": "0", - "vibration_sensor_fault": "0", - "water_box_alarm_switch_state": "0", - "water_box_lack_status": "0", - "water_box_mode_status": "0", - "water_filter_surplus_time": "0", - "water_filter_time_reset": "0", - "water_tank_install_state": "0", - "wet_and_dry_space": "0", - "wifi_fault_flag": "0", - "wifi_handshake_fault_flag": "0", - "wifi_next_sendtime": "0", - "wifi_rx_fault_flag": "0", - "wifi_setting": "0", - "wifi_tx_fault_flag": "0", - "will_fresh_light_status": "0", - "will_fress_light_exist": "0", - "will_light_market_mode_state": "0", - "will_light_mode_exist": "0", - "will_light_mode_state": "0", - "will_light_switch_state": "0", - "wine_area_switch_status": "0", - "wine_b_switch__area": "0", - "wine_light": "0", - "wine_sensor_failure_flag": "0", - "work_mode1": "0", - "work_mode2": "0" - }, - "useTime": 1710171538353, - "wifiId": "" - } -] \ No newline at end of file +{ + "bindTime": 1710171538374, + "createTime": 0, + "deviceFeatureCode": "1b0610z0049j", + "deviceFeatureName": "BCD-610WP1BWF1S3/HC4(HAB)", + "deviceId": "", + "deviceNickName": "Refrigerator", + "deviceTypeCode": "026", + "deviceTypeName": "", + "offlineState": 1, + "puid": "", + "role": 1, + "roomId": 3836987, + "roomName": "default_room", + "seq": 0, + "statusList": { + "AIR_FRESHNESS": "0", + "ODOR_SENSOR_FAULT_FLAG": "0", + "ODOR_SENSOR_NO_DISTURB_MODE_STATUS": "1", + "ODOR_SENSOR_SENSITIVITY": "3", + "ODOR_SENSOR_SWITHC_STATUS": "1", + "STERI_PURI_CYCLE_FLAG": "1", + "ai_energy_mode_switch": "0", + "alarm_key": "0", + "alarm_sound_volume": "0", + "ali_wifi_fault_flag": "0", + "automatic_ice_making": "1", + "camera_state": "0", + "charcoal_filter_expiration_alarm": "0", + "charcoal_filter_surplus_time": "0", + "charcoal_filter_time_reset": "0", + "child_lock_open_alarm": "0", + "child_lock_open_door_sound_alarm": "0", + "child_lock_switch_exist": "0", + "child_lock_switch_status": "0", + "commodity_inspection": "0", + "compressor_condition": "0", + "compressor_frequency": "0", + "condensation_fan_failure_status": "0", + "control_failure_status": "0", + "custard_room": "36", + "daily_energy_kwh": 0, + "date_display_format_status": "0", + "date_format_status": "0", + "date_time_format_day_state": "0", + "date_time_format_month_state": "0", + "date_time_format_year_state": "0", + "dbd_clean_mode": "0", + "debacilli_mode": "0", + "display_panel_ronshen": "1", + "displayboard_brand": "3", + "displayboard_key_setting": "0", + "displayboard_type": "75", + "displayboard_version": "1", + "door_close_light_status": "0", + "door_close_ui_display_status": "0", + "door_num_four_color": "0", + "door_num_one_color": "0", + "door_num_three_color": "0", + "door_num_two_color": "0", + "door_open_light_status": "0", + "door_open_ui_display_status": "0", + "electric_current": "111", + "electric_energy_one_tenths_value": "0", + "electric_energy_percentile_thousands_value": "5", + "envi_temp_sens_head_failure": "0", + "environment_humidity": "55", + "environment_real_temperature": "30", + "existing_fuzzy_mode": "0", + "existing_holiday_mode": "0", + "existing_lock_fresh_mode": "0", + "existing_save_mode": "1", + "existing_sf_mode": "1", + "existing_sr_mode": "1", + "fast_store_mode_exist": "0", + "fast_store_mode_status": "0", + "filter_alarm_time": "0", + "filter_state": "45", + "free_defrosting_failure": "0", + "free_evap_temp_sens_head_failure": "0", + "free_fan_failure": "0", + "free_key": "0", + "free_room": "1", + "free_room_open": "0", + "free_room_open_2": "0", + "free_room_over_temp_alarm_failure": "0", + "free_temp_sens_head_failure": "0", + "freeze_door_open_time": "0", + "freeze_max_temperature": "-13", + "freeze_min_temperature": "-24", + "freeze_poweroff_ad": "0", + "freeze_poweron_ad": "0", + "freeze_real_temperature": "-20", + "freeze_sensor_real_temperature": "-40", + "freeze_temperature": "-18", + "frost_state": "0", + "froze_convert_to_refri_switch_status": "0", + "fruit_vegetables_temperature": "0", + "fuzzy_mode": "0", + "gold_water_supply_mode": "0", + "high_humidity": "0", + "high_temperature": "0", + "holiday_mode": "0", + "human_on_off_status": "0", + "human_sense_light_status": "0", + "human_sense_ui_display_state": "0", + "human_sensor_switch_exist": "0", + "humdy_test_switch_state": "0", + "humidity sensor_failure": "0", + "ice_making_b_switch_status": "0", + "ice_making_full_status": "0", + "ice_making_machine_failure": "0", + "ice_making_state": "1", + "ice_sensor_failure_flag": "0", + "ice_temperature_sensor_header_failure_flag": "0", + "inlet pipe_temp_sens_head_failure": "0", + "key_press_sound_volume": "0", + "language_select": "0", + "load_operation_status2": "0", + "lock_fresh_mode": "0", + "lock_key": "0", + "low_humidity": "0", + "low_temperature": "0", + "low_wine_area_c_evaporator_fault": "0", + "low_wine_area_c_fan_fault": "0", + "low_wine_area_c_humdy_fault": "0", + "low_wine_area_c_temp_fault": "0", + "lumin_value_of_interior_light": "0", + "mainboard_type": "70", + "mainboard_version": "151", + "market_mode_exist": "0", + "measured_vibrations": "0", + "medium_humidity": "0", + "medium_temperature": "0", + "micro_water_supply_mode": "0", + "mid_wine_area_b_evaporator_fault": "0", + "mid_wine_area_b_fan_fault": "0", + "mid_wine_area_b_humdy_fault": "0", + "mid_wine_area_b_temp_fault": "0", + "mode_key": "0", + "model_type": "26", + "monitor": "0", + "monitor_set": "0", + "monitor_set_act": "0", + "night_mode_end_hour": "0", + "night_mode_end_min": "0", + "night_mode_light_dark_level": "0", + "night_mode_screen_dark_level": "0", + "night_mode_start_hour": "0", + "night_mode_start_min": "0", + "night_mode_status": "0", + "normal_sound_size": "0", + "not_active": "1", + "open_freeze_door_alarm": "0", + "open_refrigerator_door_alarm": "0", + "open_the_door_alarm": "0", + "open_variation_door_alarm": "0", + "pairing": "0", + "pairing_active": "0", + "power_hundred_ten_value": "0", + "power_one_tenths_value": "0", + "power_voltage": "0", + "quiet_mode_status": "0", + "real_humidity": "0", + "real_humidity_b": "0", + "real_humidity_c": "0", + "ref_light": "0", + "refr_defrosting_failure": "0", + "refr_dry_wet_room_sens_failure": "0", + "refr_evap_temp_sens_head_failure": "0", + "refr_fan_failure": "0", + "refr_key": "0", + "refr_room": "1", + "refr_room_open": "0", + "refr_room_over_temp_alarm": "0", + "refr_temp_sens_head_failure": "0", + "refr_var_room_sens_failure": "0", + "refrigerator_door_open_time": "0", + "refrigerator_freeze_swith": "0", + "refrigerator_freeze_swith_state": "0", + "refrigerator_max_temperature": "9", + "refrigerator_min_temperature": "2", + "refrigerator_poweroff_ad": "0", + "refrigerator_poweron_ad": "0", + "refrigerator_real_temperature": "4", + "refrigerator_sensor_real_temperature": "-24", + "refrigerator_temperature": "4", + "reserve45": "0", + "reserve46": "0", + "reserve47": "0", + "reserve48": "0", + "reserve49": "0", + "reserve50": "0", + "reserve51": "0", + "reserve52": "0", + "reserve53": "0", + "reserve54": "0", + "reserve55": "0", + "reserve56": "0", + "reserve57": "0", + "reserve58": "0", + "reserve59": "0", + "reserve60": "0", + "reserve61": "65535", + "reserve62": "65535", + "reserve63": "65535", + "reserve64": "65535", + "reserve65": "65535", + "reserve66": "65535", + "reserve67": "65535", + "reserve68": "65535", + "reserve69": "65535", + "reserve70": "65535", + "reserve71": "65535", + "reserve72": "65535", + "rgb_atmosphere_mode_b_value": "0", + "rgb_atmosphere_mode_g_value": "0", + "rgb_atmosphere_mode_r_value": "0", + "rgb_function_mode_b_value": "0", + "rgb_function_mode_g_value": "0", + "rgb_function_mode_r_value": "0", + "rgb_light_atmosphere_brightness": "0", + "rgb_light_atmosphere_on_time": "0", + "rgb_light_function_brightness": "0", + "rgb_light_function_on_time": "0", + "rgb_light_normal_brightness": "0", + "rgb_light_normal_on_time": "0", + "rgb_light_state": "0", + "rgb_normal_mode_b_value": "0", + "rgb_normal_mode_g_value": "0", + "rgb_normal_mode_r_value": "0", + "right_free_sensor_failure": "0", + "run_status_flag_5": "0", + "running_status": "0", + "running_status3": "0", + "rx_failure": "0", + "sabbath_mode_status": "0", + "sabbath_mode_switch_status": "0", + "save_mode": "0", + "screen_display_brightness": "0", + "screen_display_lock": "0", + "screen_to_clock_time": "0", + "screen_to_standby_time": "0", + "sensor_failure_status": "0", + "sensor_failure_status2": "0", + "sf_mode": "0", + "sf_sr_mutex_mode": "1", + "shelf_light_a_state": "0", + "shelf_light_atmosphere_brightness": "0", + "shelf_light_atmosphere_mode_brightness": "0", + "shelf_light_b_state": "0", + "shelf_light_c_state": "0", + "shelf_light_function_mode_brightness": "0", + "shelf_light_function_on_time": "0", + "shelf_light_normal_on_time": "0", + "show_mode": "0", + "special_space": "0", + "sr_mode": "0", + "standby_mode_state": "0", + "standby_mode_valid": "0", + "super_water_supply_mode": "0", + "temp_auto_ctrl_mode_exist": "0", + "temp_auto_ctrl_mode_state": "0", + "temperature_room_judge": "19", + "temperature_unit": "0", + "theme_color": "0", + "tx_failure": "0", + "unfreeze_run_status": "0", + "unfreeze_switch_status": "0", + "unpair_all_users": "0", + "up_wine_area_a_evaporator_fault": "0", + "up_wine_area_a_fan_fault": "0", + "up_wine_area_a_humdy_fault": "0", + "up_wine_area_a_temp_fault": "0", + "user_debacilli_mode": "0", + "vacuum_on_off_status": "0", + "var_room_open_2": "0", + "var_room_over_temp_alarm": "0", + "vari_evap_temp_sens_head_failure": "0", + "vari_key": "0", + "vari_room": "0", + "vari_room_open": "0", + "vari_temp_sens_head_failure": "0", + "variable_fan_failure_status": "0", + "variable_heater_failure_status": "0", + "variable_temperature_space ": "0", + "variation_door_open_time": "0", + "variation_max_temperature": "5", + "variation_min_temperature": "-20", + "variation_poweroff_ad": "0", + "variation_poweron_ad": "0", + "variation_real_temperature": "-40", + "variation_sensor_real_temperature": "-40", + "variation_temperature": "-40", + "vibration_alarm": "0", + "vibration_sensor_fault": "0", + "water_box_alarm_switch_state": "0", + "water_box_lack_status": "0", + "water_box_mode_status": "0", + "water_filter_surplus_time": "0", + "water_filter_time_reset": "0", + "water_tank_install_state": "0", + "wet_and_dry_space": "0", + "wifi_fault_flag": "0", + "wifi_handshake_fault_flag": "0", + "wifi_next_sendtime": "0", + "wifi_rx_fault_flag": "0", + "wifi_setting": "0", + "wifi_tx_fault_flag": "0", + "will_fresh_light_status": "0", + "will_fress_light_exist": "0", + "will_light_market_mode_state": "0", + "will_light_mode_exist": "0", + "will_light_mode_state": "0", + "will_light_switch_state": "0", + "wine_area_switch_status": "0", + "wine_b_switch__area": "0", + "wine_light": "0", + "wine_sensor_failure_flag": "0", + "work_mode1": "0", + "work_mode2": "0" + }, + "useTime": 1710171538353, + "wifiId": "" +} diff --git a/dumps/test_server.py b/dumps/test_server.py new file mode 100644 index 0000000..50e8c14 --- /dev/null +++ b/dumps/test_server.py @@ -0,0 +1,78 @@ +from aiohttp import web +import json +from os import listdir +from os.path import isfile, join + + +async def login(request): + return web.Response( + content_type="application/json", + text='{"UID": "123", "sessionInfo":{"cookieValue": "my_login_token"}}' + ) + +async def get_jwt(request): + return web.Response( + content_type="application/json", + text='{"id_token": "my_id_token"}' + ) + +async def authorize(request): + return web.Response( + content_type="application/json", + text='{"code": "my_authorization_token"}' + ) + +async def token(request): + return web.Response( + content_type="application/json", + text='{"access_token": "my_access_token", "expires_in": 86400, "refresh_token": "my_refresh_token"}' + ) + +async def get_appliances(request): + return web.Response( + content_type="application/json", + text=json.dumps(list(appliances.values())) + ) + + +async def update_appliance(request): + req = await request.json() + if req["puid"] in appliances: + appliance = appliances[req["puid"]] + if all(k in appliance["statusList"] for k in req["properties"]): + for key in req["properties"]: + appliance["statusList"][key] = req["properties"][key] + return web.Response( + content_type="application/json", + text='{"resultCode":0,"kvMap":null,"errorCode":0,"errorDesc":null}' + ) + unknowns = [key for key in req["properties"] if key not in appliance["statusList"]] + return web.Response( + content_type="application/json", + text=f'{"resultCode":-1,"kvMap":null,"errorCode":400,"errorDesc":"Unknown properies {unknowns}"}' + ) + else: + return web.Response( + content_type="application/json", + text=f'{"resultCode":-1,"kvMap":null,"errorCode":404,"errorDesc":"Unknown puid {req["puid"]}"}' + ) + + + +filenames = list(filter(lambda f: f[-5:] == ".json", [f for f in listdir(".") if isfile(join(".", f))])) +appliances = {} +for filename in filenames: + with (open(filename) as f): + appliance = json.load(f) + appliance["deviceId"] = filename[0:-5] + appliance["puid"] = f"puid{appliance['deviceId']}" + appliances[appliance["puid"]] = appliance + +app = web.Application() +app.add_routes([web.post('/accounts.login', login)]) +app.add_routes([web.post('/accounts.getJWT', get_jwt)]) +app.add_routes([web.post('/oauth/authorize', authorize)]) +app.add_routes([web.post('/oauth/token', token)]) +app.add_routes([web.get('/appliances', get_appliances)]) +app.add_routes([web.post('/appliances', update_appliance)]) +web.run_app(app)