Commit Graph

1054 Commits

Author SHA1 Message Date
Jan Bouwhuis
dea5e7454a Add MQTT lock subentry support (#150860)
Co-authored-by: Norbert Rittel <norbert@rittel.de>
2025-08-25 15:37:36 +02:00
Jan Bouwhuis
48300f4563 Use greek small letter mu "\u03bc" instead of micro sign "\u00B5" for micro unit prefix (alt 1) (#144853)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2025-08-19 18:48:50 +02:00
Jan Bouwhuis
7bd126dc8e Assert the MQTT config entry is reloaded on subentry creation and mutation (#150636) 2025-08-15 13:04:12 +02:00
Martin Hjelmare
382bf78ee0 Ignore MQTT vacuum battery warning (#150211) 2025-08-07 20:11:39 +02:00
Jan Bouwhuis
1302b6744e Deprecate MQTT vacuum battery feature and remove it as default feature (#149877)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-08-06 11:51:31 +02:00
Erik Montnemery
0d7608f7c5 Deprecate DeviceEntry.suggested_area (#149730) 2025-08-01 10:34:34 +02:00
Jan Bouwhuis
a5b075af68 Add climate support for MQTT subentries (#149451)
Co-authored-by: Norbert Rittel <norbert@rittel.de>
2025-07-30 15:20:23 +02:00
Jan Bouwhuis
0dd1e0cabb Suppress exception stack trace when writing MQTT entity state if a ValueError occured (#149583) 2025-07-30 09:06:15 +02:00
Jan Bouwhuis
c1fa721a57 Revert "Use OptionsFlowWithReload in mqtt" (#149431) 2025-07-25 15:03:44 +02:00
G Johansson
dd3c9ab3af Use OptionsFlowWithReload in mqtt (#149092) 2025-07-24 15:34:00 +02:00
Jan Bouwhuis
4c99fe9ae5 Ignore MQTT sensor unit of measurement if it is an empty string (#149006) 2025-07-18 18:57:03 +02:00
Jan Bouwhuis
29afa891ec Add YAML and discovery info export feature for MQTT device subentries (#141896)
Co-authored-by: Norbert Rittel <norbert@rittel.de>
2025-07-17 23:06:47 +02:00
Jan Bouwhuis
09104fca4d Fix hide empty sections in mqtt subentry flows (#148692) 2025-07-14 11:26:37 +02:00
Jan Bouwhuis
5a4c837328 Fix entity_id should be based on object_id the first time an entity is added (#148484) 2025-07-11 11:19:54 +02:00
Jan Bouwhuis
4f7348b8bc Fix invalid configuration of MQTT device QoS option in subentry flow (#147837) 2025-07-01 08:46:58 +02:00
Jan Bouwhuis
969809456e Move MQTT device sw and hw version to collapsed section in subentry flow (#147685)
Move MQTT device sw and hw version to collapsed section
2025-06-28 11:25:59 +02:00
Jan Bouwhuis
85e9919bbd Add entity category option to entities set up via an MQTT subentry (#146776)
* Add entity category option to entities set up via an MQTT subentry

* Rephrase

* typo

* Move entity category to entity details - remove service to action

* Move entity category to entity platform config flow step
2025-06-25 09:28:37 +02:00
Paulus Schoutsen
7f99cd2d2b Clean up start_subentry_reconfigure_flow API for tests (#147381) 2025-06-23 21:45:33 +02:00
Marc Mueller
2c13c70e12 Update ruff to 0.12.0 (#147106) 2025-06-19 20:39:09 +02:00
Jan Bouwhuis
d01758cea8 Ensure mqtt sensor has a valid native unit of measurement (#146722) 2025-06-18 15:48:38 +02:00
G Johansson
25e6eab008 Not valid hvac modes now fails in Climate (#145242)
* Not valid hvac modes now fails

* Fix some tests

* Some more

* More

* fix ruff

* HVAC

* Fritzbox

* Clean up

* Use dict[key]

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-06-12 07:15:07 +02:00
Erik Montnemery
ce739fd9b6 Restore entity ID and user customizations of deleted entities (#145278)
* Restore entity ID and user customizations of deleted entities

* Clear removed areas, categories and labels from deleted entities

* Correct test

* Fix logic for disabled_by and hidden_by

* Improve test coverage

* Fix sorting

* Always restore disabled_by and hidden_by

* Update mqtt test

* Update pglab tests
2025-06-10 11:47:54 +02:00
epenet
0cf2ee0bcb Remove unnecessary DOMAIN alias in tests (l-r) (#146009)
* Remove unnecessary DOMAIN alias in tests (l-r)

* Keep late import in lirc
2025-06-02 08:54:55 +02:00
Jan Bouwhuis
192aa76cd7 Ensure mqtt sensor unit of measurement validation for state class measurement_angle (#145648) 2025-05-28 10:16:40 +02:00
Abílio Costa
b626204f63 Add default device class display precision for Sensor (#145013)
* Add default device class display precision for Sensor

* Renaming, docstrings, cleanup

* Simplify units list

* Fix tests

* Fix missing precision when suggested is specified

* Update snapshots

* Fix when unit of measurement is not valid

* Fix tests

* Fix deprecated unit usage

* Fix goalzero tests

The sensor native_value method was accessing the data dict and trowing,
since the mock did not have any data for the sensors.

Since now the precision is always specified (it was missing for those
sensors), the throw was hitting async_update_entity_options in _update_suggested_precision.
Previously, async_update_entity_options was not called since it had no
precision.

* Fix metoffice

* Fix smartthings

* Add default sensor data for Tesla Wall Connector tests

* Update snapshots

* Revert spaces

* Update smartthings snapshots

* Add missing sensor mock for tesla wall connector

* Address review comments

* Add doc comment

* Add cap to doc comment

* Update comment

* Update snapshots

* Update comment
2025-05-26 19:40:29 +02:00
Jan Bouwhuis
301d308d5a Add payload ON and OFF options to MQTT switch subentry component (#144627)
* Add payload ON and OFF options to MQTT switch component

* Add `state_on` and `state_off` options
2025-05-26 11:12:42 +02:00
Jan Bouwhuis
2a38f03ec9 Add MQTT fan as entity platform on MQTT subentries (#144698) 2025-05-23 17:40:54 +02:00
Jan Bouwhuis
e8ea5c9d62 Add MQTT cover as entity platform on MQTT subentries (#144381)
* Add MQTT cover as entity platform on MQTT subentries

* Revert change vol.Coerce wrappers on cover schema

* Fix template validator and cleanup redundant validators

* Cleanup more redundant validators
2025-05-23 14:25:00 +02:00
XiaoXianNv-boot
f07265ece4 Set the default upgrade icon for the MQTT device to the default icon for Home Assistant instead of the icon for the MQTT integration (#144295)
* Set the default upgrade icon for the MQTT device to the default icon for Home Assistant instead of the icon for the MQTT integration

* Set the default upgrade icon for the MQTT device to the default icon for Home Assistant instead of the icon for the MQTT integration

* Set the default upgrade icon for the MQTT device to the default icon for Home Assistant instead of the icon for the MQTT integration

* Set the default upgrade icon for the MQTT device to the default icon for Home Assistant instead of the icon for the MQTT integration

* Fix failed tests

* Fix failed tests

* Cleanup unused helper option

* ruff

---------

Co-authored-by: jbouwh <jan@jbsoft.nl>
2025-05-18 01:30:04 +02:00
Jan Bouwhuis
358d904c2c Fix field validation for mqtt subentry options in sections (#144355) 2025-05-07 09:24:51 +02:00
Jan Bouwhuis
da7e9f3ab6 Ensure all default MQTT subentry option values are saved (#144347)
* Ensure all default MQTT subentry option values are saved

* Apply correct filter
2025-05-06 19:30:48 +02:00
Jan Bouwhuis
d0ed8b67c4 Add MQTT button as entity platform on MQTT subentries (#144204) 2025-05-06 13:57:27 +02:00
Jan Bouwhuis
46df29b390 Add MQTT binary_sensor as entity platform on MQTT subentries (#144142)
Add MQTT binary_sensor subentry support
2025-05-06 10:23:19 +02:00
Jan Bouwhuis
0bf807b96e Fix default entity name not the device default entity when no name set on MQTT subentry entity (#144263) 2025-05-05 21:26:56 +02:00
Jan Bouwhuis
5b0ea21607 Add light as entity platform on MQTT subentries (#141345)
* Add light as entity platform on MQTT subentries

* Improve translation strings

* Rename to separate brightness

* Remove option to use mireds for color temperature

* Fix tests

* Add translation reference

* Correct reference

* Add flash and transition feature switches

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2025-04-30 15:57:51 +02:00
epenet
a3605921c9 De-duplicate test helper function (#143437)
* De-duplicate test helper function

* One more
2025-04-22 12:04:12 +02:00
Jan Bouwhuis
7cf63d1985 Add transition and flash feature flags for MQTT JSON light (#142692) 2025-04-13 21:39:40 +02:00
Dionisis Toulatos
3489ea30dd Fix MQTT device discovery when using node_id (#142784)
* Fix device discovery when using node_id

* tests

---------

Co-authored-by: jbouwh <jan@jbsoft.nl>
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2025-04-12 19:30:06 +02:00
Jan Bouwhuis
32da8c52f7 Add test to assert different private key types are accepted and stored correctly in MQTT config flow (#142703) 2025-04-11 00:58:48 +02:00
Jan Bouwhuis
ea38639395 Validate MQTT device tracker location data before assigning (#141980)
* Validate MQTT device tracker location data before assigning

* Log warning for invalid gps_accuracy
2025-04-10 22:32:17 +02:00
Jan Bouwhuis
505dfcbcd9 Use shorthand attributes for MQTT device tracker entity (#142671) 2025-04-10 19:51:36 +02:00
Jan Bouwhuis
26663756a5 Allow max to be equal with min for mqtt number config validation (#142522) 2025-04-08 12:00:05 +02:00
Jan Bouwhuis
faac51d219 Improve error handling and logging on MQTT update entity state updates when template rederings fails (#141960) 2025-04-01 19:22:32 +02:00
Ben Jones
363b88407c Handle empty or missing state values for MQTT light entities using 'template' schema (#141177)
* check for empty or missing values when processing state messages for MQTT light entities using 'template' schema

* normalise warning logs

* add tests (one is still failing and I can't work out why)

* fix test

* improve test coverage after PR review

* improve test coverage after PR review
2025-03-31 23:16:22 +02:00
Jan Bouwhuis
377548e3a1 Fix QoS schema issue in MQTT subentries (#141531) 2025-03-26 23:35:28 +01:00
Jan Bouwhuis
febc455bc5 Add switch as entity platform on MQTT subentries (#140658) 2025-03-26 16:46:44 +01:00
Jan Bouwhuis
0de3549e6e Move QoS setting to shared device properties in MQTT device subentries configuration (#141369)
* Move QoS setting to shared device properties in MQTT device subentries configuration

* Use kwargs for validate_user_input helper
2025-03-26 15:20:08 +01:00
Jan Bouwhuis
77bf977d63 Add sensor as entity platform on MQTT subentries (#139899)
* Add sensor as entity platform on MQTT subentries

* Fix typo

* Improve device class data description

* Tweak

* Rework reconfig calculation

* Filter out last_reset_value_template if state class is not total

* Collapse expire after as advanced setting

* Update suggested_display_precision translation strings

* Make options and last_reset_template conditional, use sections for advanced settings

* Ensure options are removed properly

* Improve sensor options label, ensure UOM is set when device class has units

* Use helper to apply suggested values from component config

* Rename to `Add option`

* Fix schema builder not hiding empty sections and removing fields excluded from reconfig

* Do not hide advanced settings if values are available or are defaults

* Improve spelling and Learn more links

* Improve unit of measurement validation

* Fix UOM selector and translation strings

* Address comments from code review

* Remove stale comment

* Rename selector constant, split validator

* Simplify config validator

* Return tuple with config and errors for config validation
2025-03-26 13:34:24 +01:00
poucz
a030502489 Add MQTT cover stop tilt (#139912)
* Stop tilt move.

Stop tilt use same payload as cover - payload_stop

* Add test for STOP_TILT

* Tilt action

* Revert "Tilt action"

This reverts commit 7ce4fbb086.

* Update tests/components/mqtt/test_cover.py

Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>

* Update homeassistant/components/mqtt/cover.py

Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>

* Append CONF_PAYLOAD_STOP_TILT

* Update homeassistant/components/mqtt/cover.py

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Test for new payload

* Update tests/components/mqtt/test_cover.py

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Update tests/components/mqtt/test_cover.py

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Ruff format

* abbreviation

---------

Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2025-03-20 18:20:12 +00:00
Jan Bouwhuis
a8f1df3e55 Add availability support for MQTT subentries (#138673)
* Add availability support for MQTT subentries

* Update homeassistant/components/mqtt/config_flow.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/config_flow.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/config_flow.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/mqtt/strings.json

Co-authored-by: Erik Montnemery <erik@montnemery.com>

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2025-03-14 14:56:27 +01:00