Commit Graph

53 Commits

Author SHA1 Message Date
Brian Martin b7341b0735 Update SpotArea
Update SpotArea and CLI command to more closely reflect the app
Library:
SpotArea namedarea -> area
SpotArea customarea -> map_position

CLI Commands:
spotclean -> area
Ex: sucks area 0,1
  - will clean areas 0 and 1 / A and B

area options:
--map-postion|-p
  - will clean a specified map coordinate
Ex: sucks area -p "-602,1812,800,723"
  - will clean the specified custom map coordinates
2019-02-20 10:45:24 -05:00
Brian Martin 6c31e0752d add comments and cleanup 2019-02-18 22:22:38 -05:00
Brian Martin 597129dda0 Combine MQTT and IOT into IOTMQ
Combined MQTT and IOT into IOTMQ
Updated tests - now with 99% coverage for __init__
2019-02-18 17:44:41 -05:00
Brian Martin 9919baad27 more tests 2019-02-16 02:54:39 -05:00
Brian Martin 94a7844f78 Fix spot area clean
Fix spot area clean
2019-02-15 22:27:47 -05:00
Brian Martin b0bf467aa4 stop printing positiion updates
stop printing positiion updates
2019-02-08 02:12:54 -05:00
Brian Martin 5d6df85ed6 Fix custom commands
Fix for custom commands with multiple inner tags
Updated tests
2019-02-08 01:43:00 -05:00
Brian Martin 57979c32bd Make ssl verification optional
Make ssl verification optional
Can be set via config manually, or used from library
2019-02-03 15:18:55 -05:00
Brian Martin 2cfa5ec26b Add ignore ssl to requests
Added verify False to requests. Needed for work on Bumper
2019-01-31 09:46:04 -05:00
Brian Martin 1812a212e1 Add mqtt tests
Add mqtt tests
2019-01-20 22:25:59 -05:00
Brian Martin f3bcfb4ddc Add more iot tests
Add more iot tests
2019-01-20 16:30:53 -05:00
Brian Martin 6ff7173ddc Update __init__.py 2019-01-17 23:15:35 -05:00
Brian Martin c0eda3a6cb Fix clean from CLI
Fix clean from CLI
Inject an action='start' for IOTvacs
2019-01-17 09:55:22 -05:00
Brian Martin e2b0ea7b55 Add test MQTTPing
Add test MQTTPing & Fix tests
2019-01-17 09:13:47 -05:00
Brian Martin c72be5509a MQTT Plumbing
MQTT Client plumbed up
- Connect, disconnect, statuses working
2019-01-17 02:35:48 -05:00
Brian Martin ca7d37c193 WIP: Initial MQTT work
WIP: Add initial EcoVacsMQTT client
- Connect and get message

TODO: Parse messages and plumb to events
2019-01-16 09:02:03 -05:00
Brian Martin 3c01cd2678 Set timeout for IOT api calls
Set timeout to 1.25 secs for IOT API
- Some commands (Move) never return a status, so this allows things to continue moving along without waiting too long
2019-01-15 11:09:49 -05:00
Brian Martin 335ac6a7e1 Handle already charging
Handle already charging
Small cleanup
2019-01-15 10:16:09 -05:00
Brian Martin 4ca9750738 Fix xmpp
Fix xmpp to work with iot
2019-01-15 02:24:49 -05:00
Brian Martin 484502badd Cleanup init code
Cleanup init code from adding IOT
2019-01-14 13:59:02 -05:00
Brian Martin 62185d135f Add spotclean to cli
Add spotclean to cli
2019-01-14 13:13:02 -05:00
Brian Martin 304c576960 Add spotarea command tests
Add spotarea command tests
2019-01-14 11:23:27 -05:00
Brian Martin d317e4b913 Fix tests & Clean
Fix tests
Add tests for iot
Modify Clean to use kwargs for SpotArea
2019-01-14 10:59:25 -05:00
Brian Martin ef0bd2e90d Add backward action
Add backward action
2019-01-13 21:22:19 -05:00
Brian Martin c1f6814f8e Add clean_status for IOT
Add clean_status for IOT
- Reports cleaning or paused
2019-01-13 14:12:29 -05:00
Brian Martin 0da4532908 Add spotarea
Add SpotArea option for D90X w/ Mapping
2019-01-13 13:59:29 -05:00
Brian Martin e408157b72 Basic support for D90X
Add EcoVacsIOT in VacBot
2019-01-12 15:43:02 -05:00
William Pietri 907f21746c Merge remote-tracking branch 'origin/master' 2018-09-22 17:50:59 -07:00
William Pietri 07bd96c9c7 Apply fix from eracknaphobia/sucks for mysterious auth error issue. 2018-09-22 17:45:47 -07:00
joe248 1846e2ccf4 Fix warning due to using deprecated property 2018-08-30 10:36:03 -05:00
Greg Laabs 276721e280 Fix lifespans being reported much lower than reality
Original implementation assumed that the "total" value from the API response was the denominator for lifespan, but this was incorrect. The "val" from the `life_span` message is the percentage represented as a whole number, with no dividing necessary.
2018-07-29 15:22:31 -07:00
Greg Laabs 930e475905 Const and logging cleanup, addition of is_cleaning and is_charging
All sucks vocabulary is now defined up-front in consts, so that library users can import those const instead of hard-coding them.

is_cleaning and is_charging properties were added to VacBot, avoiding library users to have to understand which vacuum statuses mean active cleaning.

All logging has been moved to instantiated loggers using the module's namespace, as is recommended by the Python docs.
2018-07-19 12:18:22 -07:00
Greg Laabs df44def7c5 Add tests, and fix some edge cases revealed by tests (yay!) 2018-07-15 15:19:40 -07:00
Greg Laabs 269749e0ea Add event emitters, error handling, vacuum state and lifespan tracking
Tons of cleanup alongside a lot of new functionality. BotVac now provides an overall vacuum state as a single state, and can emit events to subscribers every time the state changes, as well as any lifespan or battery changes.

The BotVac can also now be created in a `monitor` mode, meaning the BotVac object will handle fetching initial state, refetching state after the BotVac goes offline then online, and regularly checking in on component lifespans.

All statuses are also now normalized so that the BotVac's reported statuses always match the names defined by the sucks library.
2018-07-13 22:10:24 -07:00
William Pietri 7ee7a2457a Merge branch 'master' into server-argument 2017-12-22 00:36:27 -05:00
Torbjörn Axelsson e7ad30eac0 Removed error handler in EcoVacsXMPP
The _handle_error method was throwing a runtime error because it expects an XML element

The functionality in _handle_error is covered by _handle_ctl so it can be removed altogether
2017-12-21 18:51:47 -08:00
Torbjörn Axelsson 8aafc37cd0 XMPP server address as optional argument 2017-12-21 18:39:59 -08:00
William Pietri d300df99eb Moving waiting logic to CLI. 2017-12-19 16:01:16 -08:00
Torbjörn Axelsson aab8d769aa Fixed mistake in ChargeAndWaitForCompletion command 2017-12-16 17:03:56 -08:00
Torbjörn Axelsson 66d73f7cf0 VacBotCommand class updated and more commands added 2017-12-16 15:26:57 -08:00
William Pietri d6e4f7d5c5 Events now flow to Vacbot as reasonably sane dicts. 2017-12-12 11:49:10 -08:00
William Pietri fbd3c3d85a Seeing if I can split the XMPP responsibilities from the vacuum responsibilities. 2017-12-11 16:14:52 -08:00
William Pietri 5dcb819d6a Merge pull request #14 from OverloadUT/fix-command-formatting
Fix for commands that need to be CamelCased
2017-12-09 13:16:33 -08:00
Greg Laabs b32ced6f5a Lowercase the args tag when building the command XML
The args tag is always lowercase, while the command name is Capitalized or CamelCased
2017-12-08 19:42:34 -08:00
Greg Laabs 072db977ef Stop capitilization adjustment on commands, allow None for args
The capitalization adjustment was breaking any commands that required CamelCase, such as GetChargeState. Args are not needed for commands such as GetChargeState, so the xml will no longer build that array if it's set to None.
2017-12-08 16:10:48 -08:00
Greg Laabs 53fad263b1 Save battery status to VacBot
Makes battery status available as a public property on VacBot
2017-12-08 15:27:25 -08:00
William Pietri d52dd40f6e Fixing bad merge. 2017-12-05 15:15:29 -08:00
William Pietri 7daa4c837f Extracting duplication. 2017-12-05 15:11:37 -08:00
William Pietri 0b5a4b6d51 Merge branch 'master' of https://github.com/Zenconomy/sucks into Zenconomy-master 2017-12-05 15:05:17 -08:00
William Pietri 60a74e6549 Minor tidying and removing unused instance variables. 2017-12-05 14:51:11 -08:00