1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-05-15 23:00:18 -07:00

89 Commits

Author SHA1 Message Date
Adrian Sampson
7fed7cd9a4 Version bump: v1.5.0 2020-08-07 07:26:37 -04:00
ankushduacodes
4d3d50a07c
Updated JET mode names in ac.py
simplified JET mode names and fixed doc strings
2020-06-15 08:30:39 +05:30
ankushduacodes
34f5fd6033
Update wideq/ac.py
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2020-06-15 08:19:07 +05:30
ankushduacodes
f7285a66d5
Update wideq/ac.py
Co-authored-by: Adrian Sampson <adrian@radbox.org>
2020-06-15 08:18:51 +05:30
ankushduacodes
c9665038ef
Added jet mode functionality to API
Jet mode functionality seems to be known by different name at different models of AC
On my AC it is known as Himalayas mode

Please Add Ankush Dua to Contributors list
2020-06-14 09:27:20 +05:30
ankushduacodes
d65bcd4e16
Added jet mode functionality to API
Jet mode functionality seems to be known by different name at different models of AC
On my AC it is known as Himalayas mode

Please Add Ankush Dua to Contributors list
2020-06-14 09:23:32 +05:30
ankushduacodes
b8237186f3
Added jet mode functionality to API
Jet mode functionality seems to be known by different name at different models of AC
On my AC it is known as Himalayas mode

Please Add Ankush Dua to Contributors list
2020-06-14 09:19:37 +05:30
Ankush Dua
86ca064065 Added jet mode functionality to API
Jet mode functionality seems to be known by different name at different models of AC
On my AC it is known as Himalayas mode
2020-06-14 08:48:45 +05:30
Adrian Sampson
64553d52e3 Version bump: 1.4.0 2020-05-11 22:04:23 -04:00
Jessica Stokes
799709c2d6
Placate Flake8 2020-05-10 11:24:21 -07:00
Jessica Stokes
78f09081f5
Request supported Operations from model info
This fixes #83 - I have the same LP1419IVSM Air Conditioner model, and it causes an error when turning on using wideq.

I've updated the ACDevice class with two new @properties, which are the list of Operations the device supports, and the best-supported ON operation from that list.

This makes the presumption that if the model reports ALL_ON as available, that it is appropriate to use (as the existing code did), but if ALL_ON is not supported by the particular model, it will fall back to using whichever ON Operation it reports as supporting. In the case of the LP1419, that will be RIGHT_ON.

Additionally, as a backstop, this will raise an error if ALL_ON is not supported but there are still more than one supported ON operation - from reading issues I haven't been able to find any evidence that such a device exists, but if one should pop up it'll likely need handling in some creative way.

These new values are now also reported in the ac-config subcommand of example.py.

Finally, this updates the set_on method to use the resultant operation name. This now means that example.py set [id] on works for my air conditioner again, and just in time for the warmer weather!
2020-05-10 11:17:50 -07:00
Noah Overcash
8f0e20c3fc
Add smart grid features to SmartSavingMode refrigerator enum
My refrigerator (LFXS28566D) supports the three added options as part of it's "smart grid" functionality.  None of the initial three options were in my fridge, so I figure they are mutually exclusive modes (although OFF and SMART_GRID_OFF are similar, as is CUSTOM and SMART_GRID_CUSTOM).

As best I can tell, SMART_GRID_OFF is for when the smart grid feature is disabled overall, SMART_GRID_DEMAND_RESPONSE is something certain power companies can do to tell the fridge not to defrost when the power grid is stressed (I cannot test as I am ineligible), and SMART_GRID_CUSTOM is used whenever the button on the fridge is pushed or "Seasonal Energy Saver" is enabled in the app.

For reference, here is an excerpt from my model's JSON dump:
```json5
{
...
"SmartSavingMode": {
    "type": "Enum",
    "default": "0",
    "option": {
        "0": "@CP_OFF_EN_W",
        "2": "@RE_TERM_DELAY_DEFROST_CAPABILITY_W",
        "3": "@RE_TERM_DEMAND_RESPONSE_FUNCTIONALITY_W"
    }
}
...
}
```
2020-05-08 10:18:15 -04:00
Adrian Sampson
fd5a695988 Recreate sessions on the fly
Adapts #88 to avoid a global session object.
2020-04-10 21:43:52 -04:00
Adrian Sampson
6af5eb1ce1 Uniform names for retry constants 2020-04-10 21:42:11 -04:00
Jason Swails
65efc281a3 Fix flake8 2020-04-10 09:29:31 -04:00
Jason Swails
c595749eb9 Incorporate review comments 2020-04-10 09:24:39 -04:00
Jason Swails
e7b5a7d28b Address review comments 2020-04-07 22:05:06 -04:00
Jason Swails
95e64dec1a Fix flake8 complaints 2020-04-07 08:07:42 -04:00
Jason Swails
6446595548 Improve retry logic 2020-04-05 10:11:12 -04:00
Frederik Gladhorn
919139d9e8 Add logging
Instead of using print, let's use Python's logging framework. That
allows switching verbosity easily and filtering out unwanted messages.
Some of the setup code is inspired by what Home Assistant does.
2020-01-31 22:01:17 +01:00
Frederik Gladhorn
be05e1b33e Allow strings in ModelInfo
The only instance where this is used is a comment,
see issue #62. For now it will just be ignored. The comment seems to
contain several times.

Fixes #62
2020-01-27 11:45:51 +01:00
David Velásquez
a44f0677e6
Update wideq/ac.py
Co-Authored-By: Adrian Sampson <adrian@radbox.org>
2020-01-22 16:56:16 -05:00
David Velásquez
23fbb20853
Update wideq/ac.py
Co-Authored-By: Adrian Sampson <adrian@radbox.org>
2020-01-22 16:56:08 -05:00
David
25479802e8 remove trailing whitespace to address flake report 2020-01-22 13:35:35 -05:00
David
547f666118 improve comment to addres flake complains 2020-01-22 13:31:47 -05:00
David
facd0c09ba return True if display light status not supported 2020-01-22 13:26:51 -05:00
David
7d6033a437 avoid crashing if DisplayControl is not supported 2020-01-22 13:10:56 -05:00
David
08bb4ca942 fix to return just the power integer value 2020-01-22 12:43:53 -05:00
David
a62572e599 Merge remote-tracking branch 'upstream/master' 2020-01-22 12:19:26 -05:00
David
7b7f1e76f6 change power usage names and added units 2020-01-22 12:17:36 -05:00
Frederik Gladhorn
d35c3ff817 Add (de)serialize methods to Gateway and Auth
This makes the parts belonging to the class more local and encapsulated.
This will make adding API v2 easier.
2020-01-22 15:34:19 +01:00
David
4122d7d188 add power readings to ac_config 2020-01-22 00:28:53 -05:00
Frederik Gladhorn
72040db991 When ModelInfo contains yet unknown values, also report the name
Then we at least have some idea (hopefully) what kind of data we are
going to ignore. See issue #62.
2020-01-13 17:19:33 +01:00
Frederik Gladhorn
5a20b35171 Report what data is available when ModelInfo contains unexpected types
It seems that the data can cointain strings (see issue #62). Let's dump what
data we have available to be able to debug this.
2020-01-13 12:51:19 +01:00
Frederik Gladhorn
655bace1ba Test Gateway instantiation and remove gateway_info
The function just forwarded to do one API call, do the same call inline
and improve testing at the same time by checking that 'Gateway' gets
instantiated correctly.
2020-01-12 21:42:10 +01:00
Frederik Gladhorn
2641e44f3e Improve type information
Most parameters to Client's __init__ are optional.
This matters when adding more types other places.
2020-01-12 11:19:31 +01:00
Frederik Gladhorn
e98d2a18d1 Add type information
This helps later refactoring.
Use mypy to check types.
2020-01-11 20:18:22 +01:00
Frederik Gladhorn
09696d94f4 Fix type errors 2020-01-11 20:18:22 +01:00
Adrian Sampson
b0b59c18dd Remove unnecessary "Boolean" enums (#65)
These enums were only used internally and never exposed to the outside
world, so they aren't really necessary---we can just do the necessary
processing internally.
2019-12-28 10:06:27 -05:00
Adrian Sampson
fc169e90e3 Docstrings & spacing for refrigerators (#65) 2019-12-28 10:02:21 -05:00
Andrey Klimov
c273a26889 Fix for flake8 2019-12-27 13:37:51 +03:00
Andrey Klimov
cfd27c0100 Merge branch 'feature/refrigerator' of https://github.com/NorDroN/wideq into feature/refrigerator
# Conflicts:
#	wideq/ac.py
2019-12-27 13:20:17 +03:00
Andrey Klimov
8eae2230f1 Remove unused import 2019-12-27 13:18:46 +03:00
Andrey Klimov
992d1d60dc
Merge branch 'master' into feature/refrigerator 2019-12-27 13:11:59 +03:00
Andrey Klimov
a54bcb04ff Add some methods (set_temp_refrigerator_c, set_temp_freezer_c)
Rename some properties
Refactoring
2019-12-27 13:10:44 +03:00
Andrey Klimov
5b1535c41c Use lookup_enum from util 2019-12-27 12:23:19 +03:00
Adrian Sampson
47765d21e4 Preserve codes for named errors
This simplifies the definition of error classes *and* preserves more
information about the underlying message from the API.
2019-12-26 13:35:53 -05:00
Adrian Sampson
dbab3fd1fe Do not crash on failed speaker volume retrieval
Fixes #63.
2019-12-26 13:33:25 -05:00
Adrian Sampson
3ac6cab147 Refactor API error handling
Use a declarative style for mapping errors. Also add a new one for an
"invalid request" message.
2019-12-26 13:13:14 -05:00
Andrey Klimov
db7a0a59d5 Add refrigerator support 2019-12-26 10:24:31 +03:00