Commit Graph

185 Commits (c677489535be5d44efaf6baa01a96f2dddd4a1af)

Author SHA1 Message Date
Daniel Shokouhi d05450487c Improve how neato displays alerts and add alerts for persistent maps (#19593)
* Improve how neato displays alerts and add alerts for persistent maps

* Review comments
2018-12-27 09:57:38 -08:00
Paulus Schoutsen 8ea0a8d40b
RFC: Deprecate auto target all for services and introduce entity_id: * (#19006)
* Deprecate auto target all

* Match on word 'all'
2018-12-13 10:07:59 +01:00
Teemu R bc69309b46 Add last clean times to xiaomi vacuum (#19043) 2018-12-05 18:20:26 +01:00
Teemu R da0542e961 Bump python-miio to 0.4.4 (#19042) 2018-12-05 18:19:30 +01:00
Sebastian Muszynski df3d82e0e3
Use async_add_executor_job at the xiaomi_miio platforms (#18294) 2018-11-07 09:03:35 +01:00
Sebastian Muszynski c75c00d568 Bump python-miio version (#18095) 2018-11-01 17:53:48 +01:00
Jeroen ter Heerdt 3f4798b5c3 MQTT Vacuum now passes error messages. (#17685)
* MQTT Vacuum now passes error messages.

* Fixing pylint error

* Use string formatting
2018-10-26 11:07:39 +02:00
Fabian Affolter 577cf0991f
Remove username from log entry (#17777) 2018-10-25 09:43:40 +02:00
Daniel Shokouhi ab826b8fe2 Use cached robot serial for Neato update (#17633)
* Use cached robot serial for neato update

* Hound
2018-10-20 14:28:30 +02:00
Daniel Shokouhi d3672f36fb Add unique_id for Neato (#17369)
* Add unique_id for Neato

* Only send the serial per review comments
2018-10-13 00:33:13 +02:00
Daniel Shokouhi 1c23a36f46 Set botvac availability (#17350)
* Set botvac availability

* Lint

* Reduce availability calls per review comments
2018-10-12 08:40:45 +02:00
Fabian Affolter 8d9da4e7b9
Upgrade construct to 2.9.45 (#16362) 2018-10-10 23:52:45 +02:00
Teemu R 78c38749ab Xiaomi Vacuum: keep error state active after erroring (#16562)
* Check for got_error to keep consistent error reporting

* reword a comment
2018-10-10 12:16:32 +02:00
Teemu R 56a43436d7 Bump python-miio requirement (#17260) 2018-10-08 22:33:06 +02:00
SNoof85 90f2990b9e Support code 7 (#17047) 2018-10-01 22:18:56 +02:00
cdce8p 121dba659c Async syntax 7, switch & tts & vacuum (#17021) 2018-10-01 08:55:00 +02:00
cdce8p dd45e99302 Remove service helper (4) (#16892)
* Update media_player

* Update lock

* Update notify

* Update remote

* Update scene

* Update vacuum

* Remove timer helpers

* Removed unused legacy helpers
2018-09-26 18:02:05 +02:00
Daniel Shokouhi e90abf1007 Set botvac state when offline (#16805) 2018-09-23 12:35:18 +02:00
Greg Laabs eca1f050cd Bump sucks (Ecovacs) lib to 0.9.3 (#16803)
* Bump sucks (Ecovacs) lib to 0.9.3

Changed code that was in place as a workaround pre-0.9.2. This version bump fixes a few issues.

* Update requirements_all
2018-09-23 09:43:01 +02:00
Daniel Shokouhi eec6722cf4 Fix return to base logic for neato (#16776) 2018-09-22 11:34:46 +02:00
Greg Laabs 72419a1afe Fix Ecovacs vacuums showing "None" for name (#16654)
Was previously checking for a missing key, when should have been checking for the value being None
2018-09-18 08:30:20 +02:00
Fabian Affolter fea1c921fc Fix link to docs (#16652) 2018-09-17 07:45:01 +02:00
Varga Tamas 93143384a8 Restore status attribute for xiaomi_vacuum (#16366)
* Added new states and exposed state/state code received from xiaomi vacuum

* Restore status attribute for xiaomi_vacuum
2018-09-08 18:13:24 +02:00
Conrad Juhl Andersen 88f72a654a Fix error when vacuum is idling (#16282) 2018-08-29 23:17:18 +02:00
Paulus Schoutsen 994b829cb4
add_devices -> add_entities (#16171)
* add_devices -> add_entities

* Lint

* PyLint

* Revert external method in scsgate
2018-08-24 16:37:30 +02:00
Sebastian Muszynski 7ed8ed83e3 Bump python-miio version (#16110) 2018-08-21 21:25:48 +02:00
Greg Laabs df6239e0fc Add ecovacs component (#15520)
* Ecovacs Deebot vacuums

* All core features implemented

Getting fan speed and locating the vac are still unsupported until sucks adds support

* Move init queries to the added_to_hass method

* Adding support for subscribing to events from the sucks library

This support does not exist in sucks yet; this commit serves as a sort of TDD approach of what such support COULD look like.

* Add OverloadUT as ecovacs code owner

* Full support for Ecovacs vacuums (Deebot)

* Add requirements

* Linting fixes

* Make API Device ID random on each boot

* Fix unique ID

Never worked before, as it should have been looking for a key, not an attribute

* Fix random string generation to work in Python 3.5 (thanks, Travis!)

* Add new files to .coveragerc

* Code review changes

(Will require a sucks version bump in a coming commit; waiting for it to release)

* Bump sucks to 0.9.1 now that it has released

* Update requirements_all.txt as well

* Bump sucks version to fix lifespan value errors

* Revert to sucks 0.9.1 and include a fix for a bug in that release

Sucks is being slow to release currently, so doing this so we can get a version out the door.

* Switch state_attributes to device_state_attributes
2018-08-20 17:42:53 +02:00
Dan Klaffenbach 8beb349e88 vacuum/xiaomi_miio: Expose "sensor_dirty_left" attribute (#16003) 2018-08-19 13:57:28 +02:00
Daniel Shokouhi c105045dab Update neato to support new StateVacuumDevice (#16035)
* Update neato to support new vacuum states

* Remove changes submitted in error

* Lint

* Review comments and fix resume cleaning

* Lint
2018-08-18 20:20:32 +02:00
Paulus Schoutsen b682e48e12
Entity service (#15991)
* Add entity service helper

* Use entity service helper

* Context
2018-08-16 09:50:11 +02:00
Conrad Juhl Andersen 3a60c8bbed Update Xiaomi Vacuum to new StateVacuumDevice (#15643)
* Add support for states

* Woof?

* Fixed some errors

* VacuumDevice -> StateVacuumDevice

* VacuumDevice -> StateVacuumDevice

* Added split of start and pause
2018-08-13 22:50:23 +02:00
Conrad Juhl Andersen b63312ff2e Vacuum component: start_pause to individual start and pause commands. (#15751)
* Add start and pause to StateVacuumDevice, move start_pause to VacuumDevice

* Updated demo vacuum and tests

* Add a few more tests
2018-08-02 19:49:38 -07:00
Conrad Juhl Andersen 2ff5b4ce95 Add support for STATES of vacuums (#15573)
* Vacuum: Added support for STATES

* Added debug logging and corrected state order

* typo

* Fix travis error, STATE = STATE for readability

* status -> state

* Changed to Entity instead of ToogleEntity

* Updated some vacuums

* Revert changes

* Revert Changes

* added SUPPORT_STATE

* Woof?

* Implement on/off if STATE not supported

* Moved new state vaccum to Class StateVacuumDevice

* Error: I should go to bed

* Moved around methods for easier reading

* Added StateVacuumDevice demo vacuum

* Added tests for StateVacuumDevice demo vacuum

* Fix styling errors

* Refactored to BaseVaccum

* Vacuum will now go back to dock

* Class BaseVacuum is for internal use only

* return -> await

* return -> await
2018-08-01 05:51:38 -07:00
Daniel Shokouhi 06c3f756b1 Implement locate service for neato (#15467)
* Implement locate service for neato

* Hound
2018-07-18 12:19:38 +02:00
Ville Skyttä bf17ed0917 More pylint 2 fixes (#15516)
* Pylint 2 useless-import-alias fixes

* Pylint 2 chained-comparison fixes

* Pylint 2 consider-using-get fixes

* Pylint 2 len-as-condition fixes
2018-07-18 11:54:27 +02:00
Andrey 02238b6412 Add python 3.7 to travis and tox (#14523)
* Add python 3.7 to travis and tox

* Use pyyaml from github

* Don't version constraints

* Fix version tag

* Change to new pyyaml release

* Python 3.7 requires xenial

* Fix namespace detection

* Use correct RegEx type

* Update pexpect to 4.6

* Use correct validation for dictionaries

* Disable Py37 incompatible packages

* Upgrade all pexpect to 4.6

* Add explicit None as default param
2018-07-07 10:48:02 -04:00
David Worsham 36f566a529 Fix Roomba exception (#15262)
* Fix Roomba exception

* Switch to single quotes
2018-07-02 14:12:25 +02:00
Daniel Shokouhi 2524dca7bf Use cached states for neato when possible (#15218) 2018-06-29 17:27:18 -04:00
Daniel Shokouhi 4fbe3bb070 Finalize BotVac D7 Support And Further Reduce Cloud Calls (#15161)
* Finalize BotVac D7 Support And Further Reduce Cloud Calls

* Lint

* Lint Again

* Implement requested changes

* Hound

* Lint
2018-06-27 22:55:27 +02:00
Ville Skyttä b92350fb55 Lint cleanup (#15103)
* Remove unneeded inline pylint disables

* Remove unneeded noqa's

* Use symbol names instead of message ids in inline pylint disables
2018-06-25 13:05:07 -04:00
Daniel Shokouhi 6cabbd2592 Update Neato Library And Reduce Cloud Calls (#15072)
* Update Neato library to 0.0.6 and reduce the amount of calls to the cloud

* Remove file commited in error

* Lint
2018-06-20 21:46:15 -04:00
Sebastian Muszynski e370d523ec Bump python-miio version (Closes: #13749) (#14796)
* Bump python-miio version

* Fix Xiaomi Power Strip V1 support (Closes: #13749)
2018-06-04 23:50:18 +02:00
NovapaX 45eb611007 renaming icons (#13982)
* renaming icons

* remove mdi:robot-vacuum

* fix other vacuums
2018-04-18 15:46:44 -04:00
Sebastian Muszynski 23b97b9105 Params of the send command can be a list now (#13905) 2018-04-18 14:38:44 +02:00
Fabian Affolter 3906250c9e
Update example (fixes #13834) (#13839) 2018-04-13 08:50:58 +02:00
Sebastian Muszynski ab9b915731 Construct version pinned (#13528)
* Construct added to the requirements

* requirements_all.txt updated
2018-03-29 17:12:11 -07:00
Sebastian Muszynski ef7fd9f380 python-miio version bumped (Closes: 13449) (#13511) 2018-03-28 15:55:05 -07:00
Sebastian Muszynski b4b779c49d python-miio version bumped. (#13055) 2018-03-10 09:11:10 -08:00
Sebastian Muszynski 222748dfbf Xiaomi MiIO Vacuum: Use a unique data key per domain (#12743)
* Use a unique data key per domain.

* Tests fixed.
2018-02-28 13:15:45 -08:00
Johann Kellerman 6d5fb49687 Roomba timeout (#12645)
* Roomba timeout

* PlatformNotReady
2018-02-25 23:43:26 -08:00
Sebastian Muszynski da9c0a1fd7 python-miio version bumped. (Closes: #12471) (#12481) 2018-02-19 20:53:20 +01:00
Sebastian Muszynski a4944da68f python-miio version bumped. (Closes: #12389, Closes: #12298) (#12392) 2018-02-14 00:17:47 +01:00
Otto Winter 678f284015 Upgrade pylint to 1.8.2 (#12274)
* Upgrade pylint to 1.8.1

* Fix no-else-return

* Fix bad-whitespace

* Fix too-many-nested-blocks

* Fix raising-format-tuple

See https://github.com/PyCQA/pylint/blob/master/doc/whatsnew/1.8.rst

* Fix len-as-condition

* Fix logging-not-lazy

Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string

* Fix stop-iteration-return

* Fix useless-super-delegation

* Fix trailing-comma-tuple

Both of these seem to simply be bugs:
 * Nest: The value of self._humidity never seems to be used anywhere
 * Dovado: The called API method seems to expect a "normal" number

* Fix redefined-argument-from-local

* Fix consider-using-enumerate

* Fix wrong-import-order

* Fix arguments-differ

* Fix missed no-else-return

* Fix no-member and related

* Fix signatures-differ

* Revert "Upgrade pylint to 1.8.1"

This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.

* Fix arguments-differ

* except for device_tracker

* Cleanup

* Fix test using positional argument

* Fix line too long

I forgot to run flake8 - shame on me... 🙃

* Fix bad-option-value for 1.6.5

* Fix arguments-differ for device_tracker

* Upgrade pylint to 1.8.2

* 👕 Fix missed no-member
2018-02-11 09:20:28 -08:00
lance36 0fd17a7c35 Much nicer icon (#12212)
mdi:robot-vacuum will be renamed mdi:roomba 
https://github.com/Templarian/MaterialDesign/issues/2368
2018-02-06 18:52:55 +01:00
Sebastian Muszynski 137933a774 python-miio version bumped. Fixes all xiaomi_miio components. (Closes: #12017, Closes: #11948, Closes: #11200) (#12188) 2018-02-05 09:14:09 +01:00
Otto Winter 8dcfd35b8b Spelling fixes (#12041)
* Spelling fixes

*Lots* of them.

* Spelling breaking changes

* Fix lint errors
2018-01-29 23:37:19 +01:00
Fabian Affolter 47e31dc9ee Fixes for PEP257 (#11810)
* Fixes for PEP257

* More updates
2018-01-20 22:35:38 -08:00
Sebastian Muszynski dd81af4cd5 python-miio version bumped. Fixes all xiaomi_miio components. (Closes: #11768) (#11837) 2018-01-20 21:27:52 +01:00
Anders Melchiorsen 8267a21bfe Lazy loading of service descriptions (#11479)
* Lazy loading of service descriptions

* Fix tests

* Load YAML in executor

* Return a copy of available services to allow mutations

* Remove lint

* Add zha/services.yaml

* Only cache descriptions for known services

* Remove lint

* Remove description loading during service registration

* Remove description parameter from async_register

* Test async_get_all_descriptions

* Remove lint

* Fix typos from multi-edit

* Remove unused arguments

* Remove unused import os

* Remove unused import os, part 2

* Remove unneeded coroutine decorator

* Only use executor for loading files

* Cleanups suggested in review

* Increase test coverage

* Fix races in existing tests
2018-01-07 14:54:16 -08:00
Dan Nixon f0bf7b0def More support for availability reporting on MQTT components (#11336)
* Abstract MQTT availability from individual components

- Moved availability topic and payloads to MQTT base schema.
- Updated components that already report availability:
  - Switch
  - Binary sensor
  - Cover

* Add availability reporting to additional MQTT components

- Light
- JSON light
- Template light
- Lock
- Fan
- HVAC
- Sensor
- Vacuum
- Alarm control panel

* Annotate MQTT platform coroutines
2018-01-01 18:32:29 -08:00
Dan Chen 3d90855ca6 Bump python-miio version (#11232) 2017-12-19 08:22:13 +01:00
Teemu R 7b452208b6 Xiaomi Vacuum: remove deprecated calls (#10839)
* vacuum.xiaomi_miio: read dnd status properly instead of using imprecise dnd flag from vacuum_state

* vacuum.xiaomi_miio: use miio package instead of mirobo

* check only that wanted calls have taken place, ignore order of calls

* Fix linting issues

* Remove empty line after docstring
2017-12-01 12:28:59 +01:00
Sebastian Muszynski d0296561f6 python-miio version bumped for improved device support. (#10720) 2017-11-21 09:23:39 +01:00
Hugo Dupras 1347c3191f Refactor Neato botvac components as a vacuum (#9946)
* Refactor Neato botvac components as a vacuum

A switch is still use to enable/disable the schedule

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* CI Hound fixes

* Fix lint errors

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* [Neato vacumm] Add sensor attributes to vacuum

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* Remove line breaks and fix docstring

* PR fixes
2017-11-03 14:25:26 +01:00
Sebastian Muszynski f2a38677fc Bump python-miio for improved device support (#10294)
* Bump python-miio for improved device support.

* Requirements defines updated.
2017-11-02 21:38:18 +01:00
Fabian Affolter cc293db5ab
Update services.yaml files (#10229)
* Add period to the description

* Update abbreviation
2017-10-30 21:39:12 +01:00
Sebastian Muszynski e8f5445acc Xiaomi MiIO Fan: Xiaomi Air Purifier 2 integration (#9837)
* Xiaomi Air Purifier 2 integration

* Flake8 errors fixed.
Changes based on review.

* Service domain ("fan") updated and services properly prefixed by xiaomi_miio.

* The underlying library is called python-miio now. Imports and requirements updated.

* Version bumped. The underlying library is called python-miio now.
2017-10-24 23:50:01 -07:00
Pascal Vizeli ce1a2cc2a6 Remove async_update (#9997) 2017-10-21 09:45:05 +02:00
Pascal Vizeli c1b197419d Fix async probs (#9924)
* Update entity.py

* Update entity_component.py

* Update entity_component.py

* Update __init__.py

* Update entity_component.py

* Update entity_component.py

* Update entity.py

* cleanup entity

* Update entity_component.py

* Update entity_component.py

* Fix names & comments / fix tests

* Revert deadlock protection

* Add tests for entity

* Add test fix name

* Update other code

* Fix lint

* Remove restore state from template entities

* Lint
2017-10-19 10:56:25 +02:00
happyleavesaoc b83059c828 move icon battery function from util to helpers (#9708) 2017-10-05 20:55:19 -07:00
Timo S 896ba7e3fa Added new statistic attributes (#9433)
* Added new statistic attributes

Added new attributes:
  - Cleaning count
  - Total cleaning time
  - Total cleaning area
  - Time left to change main brush, side brush and filter

* Code corrections

Code corrections

* Remove wronge hanging indentation

* Added new attributes

ATTR_MAIN_BRUSH_LEFT
ATTR_SIDE_BRUSH_LEFT
ATTR_FILTER_LEFT
ATTR_CLEANING_COUNT
ATTR_CLEANED_TOTAL_AREA
ATTR_CLEANING_TOTAL_TIME

* Remove trailing white space

* Corrections of the unit test for new attributes

* Hound corrections

* Init self.clean_history, self.consumable_state

* Hound correction

* - Cleaning time and total cleaning time shown in minutes
- Cleaned area and total cleaned area shown in square meters
- Main brush left, side brush left, filter left time shown in hours
- Display of the unit of measurement

* Remove trailing white spaces

* Fixed wrong continued indentation

* Fixed Hound

* Fixed Hound

* Added new statistic attributes

Added new attributes:
  - Cleaning count
  - Total cleaning time
  - Total cleaning area
  - Time left to change main brush, side brush and filter

* Code corrections

Code corrections

* Remove wronge hanging indentation

* Init self.clean_history, self.consumable_state

* Hound correction

* Remove UOM

* Merge

* Init self.clean_history, self.consumable_state

* Hound correction

* Init self.clean_history, self.consumable_state

* Hound correction

* Removed double declarations
2017-09-25 22:27:27 +02:00
Michael Prokop 08b0629eca Fix a bunch of typos (#9545)
s/Addres /Address /
s/Chnage/Change/
s/Converion/Conversion/
s/Supressing/Suppressing/
s/agains /against /
s/allready/already/
s/analagous/analogous/
s/aquired/acquired/
s/arbitray/arbitrary/
s/argment/argument/
s/aroung/around/
s/attibute/attribute/
s/auxillary/auxiliary/
s/befor /before /
s/commmand/command/
s/conatin/contain/
s/conection/connection/
s/coresponding/corresponding/
s/entites/entities/
s/enviroment/environment/
s/everyhing/everything/
s/expected expected/expected/
s/explicity/explicitly/
s/formated/formatted/
s/incomming/incoming/
s/informations/information/
s/inital/initial/
s/inteface/interface/
s/interupt/interrupt/
s/mimick/mimic/
s/mulitple/multiple/
s/multible/multiple/
s/occured/occurred/
s/occuring/occurring/
s/overrided/overridden/
s/overriden/overridden/
s/platfrom/platform/
s/positon/position/
s/progess/progress/
s/recieved/received/
s/reciever/receiver/
s/recieving/receiving/
s/reponse/response/
s/representaion/representation/
s/resgister/register/
s/retrive/retrieve/
s/reuqests/requests/
s/segements/segments/
s/seperated/separated/
s/sheduled/scheduled/
s/succesfully/successfully/
s/suppport/support/
s/targetting/targeting/
s/thats/that's/
s/the the/the/
s/unkown/unknown/
s/verison/version/
s/while loggin out/while logging out/
2017-09-23 17:15:46 +02:00
Pascal Vizeli 5de39fd118 Optimaze vacuum mqtt platform (#9439)
* Optimaze vacuum mqtt platform

* fix lint

* Update mqtt.py
2017-09-15 18:50:22 +02:00
John Boiles 175b4ae5e0 Basic MQTT vacuum support (#9386)
* Basic MQTT vacuum support

* PR feedback

* Support for fan_speed and send_command services

* Fix configurable topics

* Use configurable bools for cleaning/docked/stopped state

* Fix language in docstring

* PR feedback

* Remove duplicate vacuum/state topic defaults

* Fix incorrect template for docked value

* Move direction like default mqtt platfom/components

* fix None on templates

* fix tests

* fix int

* fix tests

* ready to merge
2017-09-15 15:39:19 +02:00
Daniel Høyer Iversen 4126b8bd13 Rename xiaomi #9425 (#9426)
* rename xiaomi to xiaomi_aqara

* rename xiaomi vacuum and xiaomi phillips light to xiaomi miio

* update discovery and tests

* style

* update discovery and tests

* Still use Philips as name
2017-09-14 18:49:03 -04:00
Sebastian Muszynski 5db55b306e Bump python-mirobo for improved device support and introduce API changes. (#9424) 2017-09-13 23:18:22 -07:00
Sebastian Muszynski 56083c0c64 Xiaomi Philips Lights integration (#9087)
* Adds support for the Xiaomi Philips LED Ball and Ceiling Lamp

* Documentation url updated.

* New component to .coveragerc added.

* Unused import removed.

* translate labeled as static method.

* Mixed parameters in log message fixed.

* Order of requirements_all.txt fixed.

* Plattform updated. It's async now.

* Simplifiable if-statement fixed.

* Some more clean-up of unneeded stuff.

* Platform schema updated.

* Component is called xiaomi_philipslight now.

* Requirements all updated.

* Initialization of some variables updated.

* Raise PlatformNotReady exception if light cannot be discovered.

* Import of math removed.
Missing space added.

* Remove unnecessary updates
2017-08-25 21:27:31 -07:00
Eugenio Panadero c92e5c147a fix DeviceException handling when updating xiaomi vacuum (#8954)
* Fix DeviceException handling when updating entity

* add DeviceException error handling to generic request
2017-08-13 15:02:48 +02:00
Philipp Schmitt 0999e2ddc4 Update roombapy to 1.3.1 to avoid installing all the mapping dependencies (#8925) 2017-08-11 11:22:22 +02:00
Philipp Schmitt e81b3f7bc0 Implement Roomba fan speed (#8863)
* Implement Roomba fanspeed

* Fix: fan_speed_list is always empty

* Log instead of raising an exception when incorrect fan speed has been provided

* Don't attempt to set any preference if fan speed is invalid
2017-08-06 23:43:33 +02:00
Eugenio Panadero c6aaacbb08 Add new service `clean_spot` to vacuums (#8862)
* Add new service `clean_spot` to vacuums

    - Add as base component service, with associated support flag to make it optional
    - Implement on Demo vacuum
    - Implement on Xiaomi vacuum
    - Update tests for platforms Demo and Xiaomi
    - Change default icon for vacuums to `mdi:roomba`, but keep the one for the Xiaomi
    - (In a polymer PR: add new service to command toolbar in the 'more-info' card)

* Add `clean_spot` service description

* fix default properties for vacuum component
2017-08-06 10:23:22 -07:00
Charles Blonde 83afd12807 Add support to Dyson 360 Eye robot vacuum using new vacuum platform (#8852)
* Add support to Dyson 360 Eye robot vacuum using new vacuum platform

* Fix tests with Python 3.5

* Code review

* Code review - v2

* Code review - v3
2017-08-06 13:08:46 +02:00
Philipp Schmitt 82a7dffc03 Wi-Fi enabled Roomba support (#8825)
* Roomba vacuum component

* Update requirements and coveragerc

* Update error handling message

* Implement changes requested by @azogue

* Add missing import

* Don't wrap commands with functools.partial

* Refactoring

* Remove state attribute and use double quotes for log messages strings

* Remove unused constants

* Sorting

* Sorting + remove None arg from dict.get() calls

* Re-sort imports
2017-08-06 11:08:45 +02:00
Eugenio Panadero a221b10694 Update xiaomi vacuum tests and include in coverage (#8845)
* Fix tests for Demo vacuum platform (and increase coverage)

* increase coverage of xiaomi vacuum tests and include in coverage

Also little fixes

* remove print statement
2017-08-05 21:45:59 +02:00
Eugenio Panadero 96f8c37dcd Xiaomi vacuum as platform of new `vacuum` component derived from ToggleEntity, and services (#8623)
* Xiaomi vacuum as component with switch, sensors and services

- Conversion from switch platform to async component.
- Add services proposed in #8416 to the new component, with shorter names.
- Add sensors for the vacuum robot as a selectable list from `battery`, `state`, `error`, `fanspeed`, `clean_time` and `clean_area` (the state attributes of the switch). The sensors don't poll, but listen to a signal to update the state, the switch fires this signal when updating.
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)

* path change in requirements_all (from switch platform to component)

* copy pasting is a bad habit

* services to the components services.yaml, modify .coveragerc

* review: use with multiple hosts, fix calls to async_add_devices, fix ranges for services

* `icon_for_battery_level` util method

* Xiaomi vacuum as platform of new component vacuum

- Created new component `vacuum` from a ToggleEntity.
- Add services `turn_on`, `turn_off`, `cleaning_play_pause`, `stop`, `return_to_base`, `locate`, `set_fanspeed` and `send_command`.
- Remove the main switch for the xiaomi vacuum (the toggable main entity is the switch).
- Add `support flags` for the common services
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)
- Move services descriptions to a yaml file for the new component.
- Update requirements_all.
- Update coveragerc.

* fix coveragerc

* fix battery icon helper to use more icons

* remove sensors, create properties and support flags for custom UI

* cleaning

* updated state_attrs for filtering in UI, renamed platform to simply `xiaomi`

* fix platform rename

* change fanspeed and expose `fanspeed_list` to use speed steps

* minor fixes

- Rename service `start_pause`
- Add 'Error' attribute only if `got_error`.
- Minor changes

* rename state attrs

* rename state attrs

* review changes: cut fan__speed, style changes, remove logging, and more

* add ATTR_COMMAND = 'command' to const

* pop entity_id from service data

* remove property accessor for vacuum object

* lint fix

* fix extra attrs names

* module level functions for calling the services

* params as optional keyword for `send_command`

* params as optional keyword for `send_command`, remove debug logs

* explicit parameters for `set_fan_speed` and `send_command`

* Demo platform for the vacuum component

* vacuum tests for the Demo platform

* some fixes

* don't omit vacuum

* vacuum tests for the Xiaomi platform

* fix test

* fix

* fix xiaomi test

* fix coveragerc

* test send command

* fix coveragerc

* fix string formatting

* The coverage is to low. It need 93% or more
2017-08-04 15:27:10 +02:00