From 572737226832b45f0d1f901c93ff05bfb3045b90 Mon Sep 17 00:00:00 2001 From: bittles Date: Fri, 23 Dec 2022 22:19:11 -0500 Subject: [PATCH] try to parse more attrib add strings from n79 to bumper that are then passed to hass --- custom_components/ecovacs/__init__.py | 3 +++ custom_components/ecovacs/manifest.json | 6 +++--- custom_components/ecovacs/sucksbumper.py | 19 +++++++++++++------ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/custom_components/ecovacs/__init__.py b/custom_components/ecovacs/__init__.py index 34ab975..6f3d07a 100644 --- a/custom_components/ecovacs/__init__.py +++ b/custom_components/ecovacs/__init__.py @@ -3,6 +3,9 @@ import logging import random import string +##import asyncio ## to do + + #just included the modified sucks in component from .sucksbumper import EcoVacsAPI, VacBot import voluptuous as vol diff --git a/custom_components/ecovacs/manifest.json b/custom_components/ecovacs/manifest.json index 35a870a..9abd890 100644 --- a/custom_components/ecovacs/manifest.json +++ b/custom_components/ecovacs/manifest.json @@ -1,10 +1,10 @@ { "domain": "ecovacs", "name": "Ecovacs Bumper", - "version": "1.0.1", + "version": "1.0.2", "documentation": "https://www.home-assistant.io/integrations/ecovacs", - "requirements": ["sleekxmppfs>=1.3.4", "click>=6", "requests>=2.18", "pycryptodome>=3.4", "pycountry-convert>=0.5", "paho-mqtt>=1.4", "stringcase>=1.2"], + "requirements": ["sleekxmppfs==1.4.1", "click>=6", "requests>=2.18", "pycryptodome>=3.4", "pycountry-convert>=0.5", "paho-mqtt>=1.4", "stringcase>=1.2"], "codeowners": ["@OverloadUT", "@mib1185"], - "iot_class": "cloud_push", + "iot_class": "local_polling", "loggers": ["sleekxmppfs", "sucksbumper"] } diff --git a/custom_components/ecovacs/sucksbumper.py b/custom_components/ecovacs/sucksbumper.py index 5950f51..386e7c5 100644 --- a/custom_components/ecovacs/sucksbumper.py +++ b/custom_components/ecovacs/sucksbumper.py @@ -83,9 +83,10 @@ CLEAN_MODE_FROM_ECOVACS = { 'border': CLEAN_MODE_EDGE, 'spot': CLEAN_MODE_SPOT, 'spot_area': CLEAN_MODE_SPOT_AREA, + 'SpotArea': CLEAN_MODE_SPOT_AREA, 'singleroom': CLEAN_MODE_SINGLE_ROOM, 'stop': CLEAN_MODE_STOP, - 'going': CHARGE_MODE_RETURNING + 'going': CHARGE_MODE_RETURNING, } FAN_SPEED_TO_ECOVACS = { @@ -95,32 +96,38 @@ FAN_SPEED_TO_ECOVACS = { FAN_SPEED_FROM_ECOVACS = { 'standard': FAN_SPEED_NORMAL, - 'strong': FAN_SPEED_HIGH + 'strong': FAN_SPEED_HIGH, } CHARGE_MODE_TO_ECOVACS = { CHARGE_MODE_RETURN: 'go', CHARGE_MODE_RETURNING: 'Going', CHARGE_MODE_CHARGING: 'SlotCharging', - CHARGE_MODE_IDLE: 'Idle' + CHARGE_MODE_IDLE: 'Idle', } CHARGE_MODE_FROM_ECOVACS = { 'going': CHARGE_MODE_RETURNING, + 'Going': CHARGE_MODE_RETURNING, 'slot_charging': CHARGE_MODE_CHARGING, - 'idle': CHARGE_MODE_IDLE + 'SlotCharging': CHARGE_MODE_CHARGING, + 'idle': CHARGE_MODE_IDLE, + 'Idle': CHARGE_MODE_IDLE, } COMPONENT_TO_ECOVACS = { COMPONENT_MAIN_BRUSH: 'Brush', COMPONENT_SIDE_BRUSH: 'SideBrush', - COMPONENT_FILTER: 'DustCaseHeap' + COMPONENT_FILTER: 'DustCaseHeap', } COMPONENT_FROM_ECOVACS = { 'brush': COMPONENT_MAIN_BRUSH, + 'Brush': COMPONENT_MAIN_BRUSH, 'side_brush': COMPONENT_SIDE_BRUSH, - 'dust_case_heap': COMPONENT_FILTER + 'SideBrush': COMPONENT_SIDE_BRUSH, + 'dust_case_heap': COMPONENT_FILTER, + 'DustCaseHeap': COMPONENT_FILTER, } def str_to_bool_or_cert(s):