Compare commits

...

18 Commits

Author SHA1 Message Date
bittles ba0a2f9ed8 revert async to push minimal change update for release
has StateVacuumEntity but no async, will push release like this that should work and push another release with async
2024-04-27 17:35:41 -05:00
bittles d1bb42c769 change VacuumEntity to StateVacuumEntity 2024-04-27 17:32:39 -05:00
bittles 4ac0dc84d1 Make setup of Ecovacs async (#96200) * make setup async * apply suggestions
Bring code up to date with ecovacs component from commit cce9d93 on 7/24/23
2024-04-27 17:16:45 -05:00
bittles cacb0b40bb Merge pull request #17 from bittles/dev
cant comment block inside class call
2023-01-19 18:44:55 -05:00
bittles dc032f6719 cant comment block inside class call 2023-01-19 18:44:33 -05:00
bittles 9355f86e2d Merge pull request #16 from bittles/dev
Update README.md
2023-01-19 16:57:54 -05:00
bittles d2a0537b37 Update README.md 2023-01-19 16:57:35 -05:00
bittles f8ba0dd6da Merge pull request #15 from bittles/dev
fix longstanding error handling i hope
2023-01-19 16:54:47 -05:00
bittles d5370a5152 Update sucks.py 2023-01-19 16:53:49 -05:00
bittles a483d30625 fix error handling, bump to 1.5.2 2023-01-19 16:52:06 -05:00
bittles 64d62abf93 fix readme 2023-01-19 11:26:37 -05:00
bittles 6e5c0c170b readme* 2023-01-18 00:30:47 -05:00
bittles 9b52bc8e1d update readme 2023-01-18 00:28:36 -05:00
bittles 9652c47d42 Update sucks.py 2023-01-18 00:03:42 -05:00
bittles e24360fe91 Merge pull request #14 from bittles/dev
Fix import API_PORTAL_URL_FORMAT
2023-01-16 13:22:43 -05:00
bittles 45244f3744 Bump version to 1.5.1 2023-01-16 13:21:19 -05:00
bittles 646ff4ecbb Add API_PORTAL_URL_FORMAT import 2023-01-16 13:19:42 -05:00
bittles 3d5fd6c024 Fix const calls 2023-01-16 13:17:54 -05:00
6 changed files with 39 additions and 11 deletions
+1 -1
View File
@@ -78,4 +78,4 @@ Make component async, use config_flow, create device and clean up some of the ha
### Misc Info From Making This ### Misc Info From Making This
Commit history is a bit of a mess. master branch shows changes from bmartins fork of sucks to v1.3.0 of this custom component. dev branch shows commits from my attempts at testing and getting this to work. Commit history is a bit of a mess. master branch shows changes from bmartins fork of sucks to v1.3.0 of this custom component. dev branch shows commits from my attempts at testing and getting this to work.
Added additional catches to sucks because my N79 sends some weird payloads, but attributes all pull in now for brush life spans. Couple initial queries it also sends weird that I'm in process of catching atm. As of version 1.3.0 (in the manifest.json) these initial queries and all attributes are working. Was using an implementation completely mine but saw in the MQTT class there were already catches for child payloads without the main payload having the expected td in its payload. Kept comments in giving credit and adapted them to work with xmpp. Added additional catches to sucks because my N79 sends some weird payloads, but attributes all pull in now for brush life spans. Couple initial queries it also sends weird that I'm in process of catching atm. As of version 1.3.0 (in the manifest.json) these initial queries and all attributes are working. Was using an implementation completely mine but saw in the MQTT class there were already catches for child payloads without the main payload having the expected td in its payload. Kept comments in giving credit and adapted them to work with xmpp.
+1
View File
@@ -1,3 +1,4 @@
"""Support for Ecovacs Deebot vacuums.""" """Support for Ecovacs Deebot vacuums."""
import random import random
import string import string
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"domain": "ecovacs", "domain": "ecovacs",
"name": "Ecovacs Bumper", "name": "Ecovacs Bumper",
"version": "1.5.0", "version": "1.5.3",
"documentation": "https://github.com/bittles/ha_ecovacs_bumper", "documentation": "https://github.com/bittles/ha_ecovacs_bumper",
"issue_tracker": "https://github.com/bittles/ha_ecovacs_bumper/issues", "issue_tracker": "https://github.com/bittles/ha_ecovacs_bumper/issues",
"requirements": ["sleekxmppfs==1.4.1", "requests>=2.18", "pycryptodome>=3.4", "pycountry-convert>=0.5", "paho-mqtt>=1.4", "stringcase>=1.2"], "requirements": ["sleekxmppfs==1.4.1", "requests>=2.18", "pycryptodome>=3.4", "pycountry-convert>=0.5", "paho-mqtt>=1.4", "stringcase>=1.2"],
+32 -5
View File
@@ -7,6 +7,7 @@ import os
from sleekxmppfs.xmlstream import ET from sleekxmppfs.xmlstream import ET
from sleekxmppfs.exceptions import XMPPError from sleekxmppfs.exceptions import XMPPError
#from . import sucks_api
from .sucks_mqtt import EcoVacsIOTMQ from .sucks_mqtt import EcoVacsIOTMQ
from .sucks_xmpp import EcoVacsXMPP from .sucks_xmpp import EcoVacsXMPP
@@ -105,14 +106,40 @@ class VacBot():
getattr(self, method)(ctl) getattr(self, method)(ctl)
def _handle_error(self, event): def _handle_error(self, event):
if 'error' in event: if 'error' in event or 'errs' in event:
error = event['error'] error = '' # init error var so it's available outside of first if loop
elif 'errs' in event: if 'error' in event:
error = event['errs'] error = event['error']
if not error == '': elif 'errs' in event:
error = event['errs']
self.errorEvents.notify(error) self.errorEvents.notify(error)
LOGGER.error("*** error = " + error) LOGGER.error("*** error = " + error)
# if not error == '':
# Errors
# The bot broadcasts error codes for a number of cases.
# <ctl td="error" error="BatteryLow" errno="101"></ctl>
# The latest error can be requested like so:
# Request <ctl td="GetError" />
# Response <ctl ret="ok" errs="100"/>
# However in some cases the robot sends to code 100 shortly after an error has occurred, meaning that we cannot trust the GetError request to contain the last relevant error. For example, if the robot gets stuck it broadcasts 102 HostHang, then proceeds to stop and broadcasts 100 NoError.
# Known error codes
# 100 NoError: Robot is operational
# 101 BatteryLow: Low battery
# 102 HostHang: Robot is stuck
# 103 WheelAbnormal: Wheels are not moving as expected
# 104 DownSensorAbnormal: Down sensor is getting abnormal values
# 110 NoDustBox: Dust Bin Not installed
# These codes are taken from model M81 Pro. Error codes may differ between models.
def _handle_life_span(self, event): def _handle_life_span(self, event):
type = event['type'] type = event['type']
try: try:
+1 -1
View File
@@ -10,7 +10,7 @@ from paho.mqtt import publish as MQTTPublish
from paho.mqtt import subscribe as MQTTSubscribe from paho.mqtt import subscribe as MQTTSubscribe
from sleekxmppfs.xmlstream import ET from sleekxmppfs.xmlstream import ET
from .sucks_api_const import API_REALM, API_IOTDEVMANAGERAPI from .sucks_api_const import API_REALM, API_IOTDEVMANAGERAPI, API_PORTAL_URL_FORMAT
import logging import logging
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
+3 -3
View File
@@ -7,7 +7,7 @@ from typing import Any
#sucks #sucks
from . import sucks from . import sucks
from homeassistant.components.vacuum import VacuumEntity, VacuumEntityFeature from homeassistant.components.vacuum import StateVacuumEntity, VacuumEntityFeature
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.icon import icon_for_battery_level from homeassistant.helpers.icon import icon_for_battery_level
@@ -35,7 +35,7 @@ def setup_platform(
add_entities(vacuums, True) add_entities(vacuums, True)
class EcovacsVacuum(VacuumEntity): class EcovacsVacuum(StateVacuumEntity):
"""Ecovacs Vacuums such as Deebot.""" """Ecovacs Vacuums such as Deebot."""
_attr_fan_speed_list = [sucks.FAN_SPEED_NORMAL, sucks.FAN_SPEED_HIGH] _attr_fan_speed_list = [sucks.FAN_SPEED_NORMAL, sucks.FAN_SPEED_HIGH]
@@ -183,4 +183,4 @@ class EcovacsVacuum(VacuumEntity):
attr_name = ATTR_COMPONENT_PREFIX + key attr_name = ATTR_COMPONENT_PREFIX + key
data[attr_name] = int(val * 100) data[attr_name] = int(val * 100)
return data return data