Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ba0a2f9ed8 | |||
| d1bb42c769 | |||
| 4ac0dc84d1 | |||
| cacb0b40bb | |||
| dc032f6719 | |||
| 9355f86e2d | |||
| d2a0537b37 | |||
| f8ba0dd6da | |||
| d5370a5152 | |||
| a483d30625 | |||
| 64d62abf93 | |||
| 6e5c0c170b | |||
| 9b52bc8e1d | |||
| 9652c47d42 | |||
| e24360fe91 | |||
| 45244f3744 | |||
| 646ff4ecbb | |||
| 3d5fd6c024 |
@@ -1,3 +1,4 @@
|
||||
|
||||
"""Support for Ecovacs Deebot vacuums."""
|
||||
import random
|
||||
import string
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"domain": "ecovacs",
|
||||
"name": "Ecovacs Bumper",
|
||||
"version": "1.5.0",
|
||||
"version": "1.5.3",
|
||||
"documentation": "https://github.com/bittles/ha_ecovacs_bumper",
|
||||
"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"],
|
||||
|
||||
@@ -7,6 +7,7 @@ import os
|
||||
from sleekxmppfs.xmlstream import ET
|
||||
from sleekxmppfs.exceptions import XMPPError
|
||||
|
||||
#from . import sucks_api
|
||||
from .sucks_mqtt import EcoVacsIOTMQ
|
||||
from .sucks_xmpp import EcoVacsXMPP
|
||||
|
||||
@@ -105,14 +106,40 @@ class VacBot():
|
||||
getattr(self, method)(ctl)
|
||||
|
||||
def _handle_error(self, event):
|
||||
if 'error' in event:
|
||||
error = event['error']
|
||||
elif 'errs' in event:
|
||||
error = event['errs']
|
||||
if not error == '':
|
||||
if 'error' in event or 'errs' in event:
|
||||
error = '' # init error var so it's available outside of first if loop
|
||||
if 'error' in event:
|
||||
error = event['error']
|
||||
elif 'errs' in event:
|
||||
error = event['errs']
|
||||
self.errorEvents.notify(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):
|
||||
type = event['type']
|
||||
try:
|
||||
|
||||
@@ -10,7 +10,7 @@ from paho.mqtt import publish as MQTTPublish
|
||||
from paho.mqtt import subscribe as MQTTSubscribe
|
||||
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
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -7,7 +7,7 @@ from typing import Any
|
||||
#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.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.icon import icon_for_battery_level
|
||||
@@ -35,7 +35,7 @@ def setup_platform(
|
||||
add_entities(vacuums, True)
|
||||
|
||||
|
||||
class EcovacsVacuum(VacuumEntity):
|
||||
class EcovacsVacuum(StateVacuumEntity):
|
||||
"""Ecovacs Vacuums such as Deebot."""
|
||||
|
||||
_attr_fan_speed_list = [sucks.FAN_SPEED_NORMAL, sucks.FAN_SPEED_HIGH]
|
||||
|
||||
Reference in New Issue
Block a user