141 Commits

Author SHA1 Message Date
Teemu R.
8259d28b12 dustbin_mode: add 'off' mode for cleaner downstream impl ()
Adds a new artificial "Off" mode for dustbin_mode,
which will allow avoiding the need to expose both a toggle and a select
in homeassistant.

This changes the behavior of the existing mode selection, as it is not
anymore possible to change the mode without activating the auto
collection.

* Mode is Off, if auto collection has been disabled
* When setting mode to "Off", this will disable the auto collection
* When setting mode to anything else than "Off", the auto collection
will be automatically enabled.
2025-02-02 14:00:49 +01:00
Steven B.
82fbe1226e Do not return empty string for custom light effect name () 2025-01-29 18:49:06 +00:00
Teemu R.
781d07f6a2 Convert carpet_clean_mode to carpet_boost switch () 2025-01-26 16:16:24 +00:00
Teemu R.
1df05af208 Change category for empty dustbin feature from Primary to Config () 2025-01-26 16:14:45 +00:00
Steven B.
656c88771a Add common alarm interface ()
Add a common interface for the `alarm` module across `smart` and `smartcam` devices.
2025-01-26 13:33:13 +00:00
Teemu R.
d857cc68bb Allow passing alarm parameter overrides ()
Allows specifying alarm parameters duration, volume and sound.
Adds new feature: `alarm_duration`.
Breaking change to `alarm_volume' on the `smart.Alarm` module is changed from `str` to `int`
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
2025-01-26 13:13:09 +00:00
Teemu R.
62c1dd87dc Add powerprotection module ()
Implements power protection on supported devices.
If the power usage is above the given threshold and the feature is
enabled, the device will be turned off.

Adds the following features:
* `overloaded` binary sensor
* `power_protection_threshold` number, setting this to `0` turns the
feature off.

---------

Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
2025-01-26 01:43:02 +01:00
Ryan Nitcher
0aa1242a00 Report 0 for instead of None for zero current and voltage ()
- Report `0` instead of `None` for current when current is zero.
- Report `0` instead of `None` for voltage when voltage is zero
2025-01-25 10:22:00 +01:00
Steven B.
09fce3f426 Add common childsetup interface ()
Add a common interface for the `childsetup` module across `smart` and `smartcam` hubs.
Co-authored-by: Teemu R. <tpr@iki.fi>
2025-01-24 08:08:04 +00:00
Teemu R.
b6a584971a Add error code 7 for clean module () 2025-01-23 11:43:02 +00:00
Steven B.
5e57f8bd6c Add childsetup module to smartcam hubs ()
Add the `childsetup` module for `smartcam` hubs to allow pairing and unpairing child devices.
2025-01-23 09:42:37 +00:00
Teemu R.
307173487a Only log one warning per unknown clean error code and status ()
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
2025-01-22 16:58:04 +00:00
Steven B.
fa0f7157c6 Deprecate legacy light module is_capability checks ()
Deprecate the `is_color`, `is_dimmable`, `is_variable_color_temp`, `valid_temperate_range`,
and `has_effects` attributes from the `Light` module, as consumers should use
`has_feature("hsv")`, `has_feature("brightness")`, `has_feature("color_temp")`,
`get_feature("color_temp").range`, and `Module.LightEffect in dev.modules` respectively.

Calling the deprecated attributes will emit a `DeprecationWarning`
and type checkers will fail them.
2025-01-22 10:26:37 +00:00
Teemu R.
a03a4b1d63 Add consumables module for vacuums ()
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
2025-01-20 12:50:39 +00:00
Teemu R.
05085462d3 Add support for cleaning records ()
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
2025-01-20 11:41:56 +00:00
Teemu R.
bca5576425 Add support for pairing devices with hubs ()
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
2025-01-20 10:36:06 +00:00
Teemu R.
980f6a38ca Add childlock module for vacuums ()
Add new configuration feature:
```
Child lock (child_lock): False
```
---------

Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
2025-01-17 12:15:51 +00:00
Teemu R.
773801cad5 Add setting to change carpet clean mode ()
Add new setting to control carpet clean mode:
```
== Configuration ==
Carpet clean mode (carpet_clean_mode): Normal *Boost*
```
2025-01-15 19:35:41 +00:00
Teemu R.
d27697c50f Add ultra mode (fanspeed = 5) for vacuums () 2025-01-15 19:11:10 +00:00
Steven B.
b23019e748 Enable dynamic hub child creation and deletion on update () 2025-01-15 19:10:32 +00:00
Teemu R.
17356c10f1 Add mop module ()
Adds the following new features: a setting to control water level and a sensor if the mop is attached:
```
Mop water level (mop_waterlevel): *Disable* Low Medium High
Mop attached (mop_attached): True
```
2025-01-15 19:12:33 +01:00
Teemu R.
bc97c0794a Add setting to change clean count ()
Adds a setting to change the number of times to clean:
```
== Configuration ==
Clean count (clean_count): 1 (range: 1-3)
```
2025-01-15 19:11:33 +01:00
Teemu R.
2ab42f59b3 Fallback to is_low for batterysensor's battery_low ()
Fallback to `is_low` if `at_low_battery` is not available.
2025-01-15 14:33:05 +01:00
Teemu R.
1355e85f8e Expose current cleaning information ()
Add new sensors to show the current cleaning state:
```
Cleaning area (clean_area): 0 0
Cleaning time (clean_time): 0:00:00
Cleaning progress (clean_progress): 100 %
```
2025-01-15 14:20:19 +01:00
Teemu R.
2542516009 Add vacuum speaker controls ()
Implements `speaker` and adds the following features:
* `volume`  to control the speaker volume
* `locate` to play "I'm here sound"
2025-01-14 16:48:34 +00:00
Teemu R.
3c98efb015 Implement vacuum dustbin module (dust_bucket) ()
Initial implementation for dustbin auto-emptying.

New features:
- `dustbin_empty` action to empty the dustbin immediately
- `dustbin_autocollection_enabled` to toggle the auto collection
- `dustbin_mode` to choose how often the auto collection is performed
2025-01-14 17:30:18 +01:00
Teemu R.
1be87674bf Initial support for vacuums (clean module) ()
Adds support for clean module:
- Show current vacuum state
- Start cleaning (all rooms)
- Return to dock
- Pausing & unpausing
- Controlling the fan speed

---------

Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
2025-01-14 15:35:09 +01:00
Steven B.
a211cc0af5 Update hub children on first update and delay subsequent updates () 2025-01-13 17:19:40 +00:00
Teemu R.
fe88b52e19 Fallback to other module data on get_energy_usage errors ()
- The `get_energy_usage` query can fail if the device time is not set because the response includes the device time.
- Make `get_energy_usage` an optional query response so the energy module can fall back to getting the power from `get_emeter_data` or `get_current_power` on error.
- Devices on `energy_monitoring` version 1 still fail as they have no additional queries to fall back to.
2024-12-20 08:53:07 +00:00
Steven B.
c439530f93 Add bare bones homekit modules smart and smartcam devices () 2024-12-14 13:34:58 +00:00
Steven B.
2ca6d3ebe9 Add bare-bones matter modules to smart and smartcam devices () 2024-12-13 19:45:38 +00:00
Steven B.
7709bb967f Update cli, light modules, and docs to use FeatureAttributes () 2024-12-11 15:53:35 +00:00
Teemu R.
032cd5d2cc Improve overheat reporting ()
Different devices and different firmwares report overheated status in
different ways.
Some devices indicate support for `overheat_protect` component, but
there are devices that report `overheat_status` even when it is not
listed.
Some other devices use `overheated` boolean that was already previously
supported, but this PR adds support for much more devices that use
`overheat_status` for reporting.

The "overheated" feature is moved into its own module, and uses either
of the ways to report this information.
This will also rename `REQUIRED_KEY_ON_PARENT` to `SYSINFO_LOOKUP_KEYS`
and change its logic to check if any of the keys in the list are found
in the sysinfo.

```
tpr@lumipyry ~/c/p/tests (fix/overheated)> ag 'overheat_protect' -c|wc -l
15
tpr@lumipyry ~/c/p/tests (fix/overheated)> ag 'overheated' -c|wc -l
38
tpr@lumipyry ~/c/p/tests (fix/overheated)> ag 'overheat_status' -c|wc -l
20
```

---------

Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
2024-12-11 01:01:36 +01:00
Teemu R.
0c755f7120 Include duration when disabling smooth transition on/off ()
Fixes 
2024-11-26 10:39:31 +00:00
Teemu R.
69e08c2385 Expose energy command to cli ()
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
2024-11-26 09:42:55 +00:00
Steven B.
3dfada7575 Add common Thermostat module () 2024-11-26 09:37:15 +00:00
Steven B.
cb4e28394d Update docs for the new module attributes has/get feature () 2024-11-26 08:38:20 +00:00
Steven B.
37cc4da7b6 Allow getting Annotated features from modules ()
Co-authored-by: Teemu R. <tpr@iki.fi>
2024-11-22 07:52:23 +00:00
Ryan Nitcher
dab64e5d48 Add voltage and current monitoring to smart Devices () 2024-11-20 18:18:30 +00:00
Steven B.
df48c21900 Migrate triggerlogs to mashumaru () 2024-11-20 13:21:08 +00:00
Steven B.
999e84d2de Migrate smart firmware module to mashumaro () 2024-11-20 11:54:13 +00:00
Steven B.
a01247d48f Remove support for python <3.11 ()
Python 3.11 ships with latest Debian Bookworm. 
pypy is not that widely used with this library based on statistics. It could be added back when pypy supports python 3.11.
2024-11-18 18:46:36 +00:00
Teemu R.
66eb17057e Enable ruff check for ANN () 2024-11-10 18:55:13 +00:00
Teemu R.
0360107e3f Add childprotection module ()
When turned on, rotating the thermostat will not change the target
temperature.
2024-11-01 20:46:36 +01:00
Teemu R.
70c96b5a5d Initial trigger logs implementation ()
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
2024-11-01 15:36:09 +00:00
Steven B.
673a32258f Make HSV NamedTuple creation more efficient () 2024-10-29 17:14:52 +00:00
Fulch36
8b95b7d557 Fallback to get_current_power if get_energy_usage does not provide current_power () 2024-10-25 19:24:43 +01:00
Steven B.
cd0a74ca96 Improve supported module checks for hub children ()
No devices in `fixtures/smart/child` support the `get_device_time` or
`get_device_usage` methods so this PR tests for whether the device is a
hub child and marks those modules/methods as not supported. This
prevents features being erroneously created on child devices.

It also moves the logic for getting the time from the parent module
behind getting it from the child module which was masking the creation
of these unsupported modules.
2024-10-23 17:17:27 +02:00
Teemu R.
8a17752ae2 Add waterleak alert timestamp ()
The T300 reports the timestamp of the last alarm, this exposes it to
consumers.
2024-10-18 13:18:12 +02:00
Steven B.
7fd8c14c1f Create common Time module and add time set cli command () 2024-10-15 08:59:25 +01:00