Jan Bouwhuis
f21c0679b4
Rework mqtt callbacks for camera, image and event ( #118109 )
2024-05-25 11:23:45 -10:00
Jan Bouwhuis
6f81852eb4
Rename MQTT mixin classes ( #118039 )
2024-05-24 15:41:59 +02:00
Jan Bouwhuis
9333965b23
Create bound callback_message_received method for handling mqtt callbacks ( #117951 )
...
* Create bound callback_message_received method for handling mqtt callbacks
* refactor a bit
* fix ruff
* reduce overhead
* cleanup
* cleanup
* Revert changes alarm_control_panel
* Add sensor and binary sensor
* use same pattern for MqttAttributes/MqttAvailability
* remove useless function since we did not need to add to it
* code cleanup
* collapse
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-24 11:18:25 +02:00
Jan Bouwhuis
050fc73056
Refactor shared mqtt schema's to new module ( #117944 )
...
* Refactor mqtt schema's to new module
* Remove unrelated change
2024-05-23 01:12:25 +02:00
J. Nick Koston
4e3c4400a7
Refactor MQTT to replace get_mqtt_data with HassKey ( #117899 )
2024-05-21 23:21:51 -10:00
Jan Bouwhuis
96ccf7f2da
Log some mqtt of the discovery logging at debug level ( #117185 )
2024-05-10 14:49:27 +02:00
Jan Bouwhuis
20b29242f1
Make the mqtt discovery update tasks eager and fix race ( #117105 )
...
* Fix mqtt discovery race for update rapidly followed on creation
* Revert unrelated renaming local var
2024-05-08 21:42:11 +02:00
Jan Bouwhuis
821c7d813d
Correct formatting mqtt MQTT_DISCOVERY_DONE and MQTT_DISCOVERY_UPDATED message ( #116947 )
2024-05-06 22:32:46 +02:00
J. Nick Koston
ee535ee611
Ensure test async_create_task eager start behavior matches production ( #115517 )
2024-04-13 15:58:52 -05:00
Marc Mueller
443bfee16d
Replace partial annotations ( #114177 )
2024-03-28 18:33:39 +01:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 ( #112690 )
...
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller
cef20506dc
Replace EventType with Event [missing] ( #112753 )
2024-03-08 21:56:42 +01:00
Marc Mueller
84c44c1835
Replace EventType with Event [l-s] ( #112741 )
2024-03-08 19:37:18 +01:00
Marc Mueller
59a6035d3f
Add empty line after module docstring [j-m] ( #112700 )
2024-03-08 09:01:29 -05:00
Jan Bouwhuis
c13231fc00
Improve mqtt value template error logging ( #110492 )
...
* Refactor mqtt value template error logging
* Remove import
2024-03-04 08:49:12 +01:00
Jan Bouwhuis
afa4e76248
Optimize mqtt device cleanup ( #111170 )
...
Thnx
2024-02-23 07:29:50 +01:00
Jan Bouwhuis
09f1ec78a5
Handle template errors on MQTT payload handling ( #110180 )
...
* Handle template errors on MQTT payload handling (alt)
* Handle mqtt event en image template errors correctly
2024-02-13 10:59:55 +01:00
Marc Mueller
bf8bd5ff21
Use dict.get instead of inline if ( #109693 )
2024-02-05 13:56:10 +01:00
Jan Bouwhuis
26058bf922
Add serial_number attribute to MQTT device properties ( #108105 )
2024-01-16 14:02:34 +01:00
Jan Bouwhuis
f0ec1235b1
Remove naming warnings and work-a-rounds for incorrectly configured MQTT entities ( #107188 )
...
* Remove naming warnings for MQTT entities
* Remove unused const
2024-01-05 09:32:22 +01:00
Jan Bouwhuis
c7b6c9da31
Remove work-a-round for mqtt sensors with an entity_category set to config
( #107199 )
...
* Remove work-a-round for mqtt sensors with an entity_category set to `config`
* Cleanup strings
2024-01-05 09:24:52 +01:00
Ville Skyttä
24b1e01d71
Update Ruff to 0.1.8, avoid linter/formatter conflicts ( #106080 )
...
* Disable Ruff rules that may conflict with the formatter
* Upgrade Ruff to 0.1.8
- https://github.com/astral-sh/ruff/releases/tag/v0.1.7
- https://github.com/astral-sh/ruff/releases/tag/v0.1.8
* Format with Ruff 0.1.8
2023-12-20 23:55:09 +01:00
Erik Montnemery
9020dbb093
Remove context_recent_time property from entity base class ( #105652 )
2023-12-14 08:33:31 +01:00
Jan Bouwhuis
8a1f7b6802
Add translation key for some mqtt exceptions ( #104550 )
2023-11-26 17:33:54 +01:00
Jan Bouwhuis
cbccdbc6fa
Fix entity category for sensor fails mqtt sensor platform setup ( #103449 )
2023-11-08 00:03:47 +01:00
Jan Bouwhuis
4a4d2ad743
Fix mqtt config validation error handling ( #103210 )
...
* Fix MQTT config check
* Fix handling invalid enity_category for sensors
* Improve docstr
* Update comment
* Use correct util for yaml dump
2023-11-02 10:57:00 +01:00
Jan Bouwhuis
973b8900a9
Optimize mqtt platform setup ( #102449 )
...
* Optimize mqtt platform setup and correct issue
* Avoid coroutine for setup entity from discovery
* Avoid extra check
* Revert string constants
* Add comment
2023-10-22 08:31:08 +02:00
Jan Bouwhuis
25ab622b51
Rename mqtt entry setup helpers to reflect their purpose ( #102378 )
...
Rename mqtt entry setup helpers
2023-10-20 13:36:24 +02:00
Jan Bouwhuis
7d9014ae41
Do not fail MQTT setup if events or sensors configured via yaml can't be validated ( #102309 )
...
* Add event and sensor
* Cleanup unused code
* Schema cannot be None for supported platform
2023-10-20 12:09:52 +02:00
Jan Bouwhuis
d149bffb07
Do not fail MQTT setup if lights configured via yaml can't be validated ( #101649 )
...
* Add light
* Deduplicate code
* Follow up comment
2023-10-19 17:34:43 +02:00
Jan Bouwhuis
c377cf1ce0
Do not fail mqtt entry on single platform config schema error ( #101373 )
...
* Do not fail mqtt entry on platform config
* Raise on reload with invalid config
* Do not store issues
* Follow up
2023-10-19 12:06:33 +02:00
Jan Bouwhuis
aed3ba3acd
Avoid redundant calls to async_ha_write_state
in MQTT (binary) sensor ( #100438 )
...
* Only call `async_ha_write_state` on changes.
* Make helper class
* Use UndefinedType
* Remove del
* Integrate monitor into MqttEntity
* Track extra state attributes and availability
* Add `__slots__`
* Add monitor to MqttAttributes and MqttAvailability
* Write out loop
* Add test
* Make common test and parameterize
* Add test for last_reset attribute
* MqttMonitorEntity base class
* Rename attr and update docstr `track` method.
* correction doct
* Implement as a decorator
* Move tracking functions into decorator
* Rename decorator
* Follow up comment
2023-09-21 13:33:26 +02:00
Jan Bouwhuis
6b265120b3
Fix entity name attribute on mqtt entity is not removed on update ( #100187 )
...
Fix entity name attribute is not remove on update
2023-09-12 15:22:37 +02:00
Jan Bouwhuis
20d0ebe3fa
Add TYPE_CHECKING condition on type assertions for mqtt ( #100107 )
...
Add TYPE_CHECKING condition on type assertions
2023-09-11 10:58:33 +02:00
Jan Bouwhuis
8b232047c4
Add origin info support for MQTT discovered items ( #98782 )
...
* Add integration info support for MQTT discovery.
* Moving logs to discovery
* Revert adding class property
* Rename to origin
* Follow up comments
2023-08-24 09:50:39 +02:00
Franck Nijhof
c39fc0766e
Remove repair issue for MQTT discovered items ( #98768 )
2023-08-21 20:03:19 +02:00
Erik Montnemery
045c327928
Move DeviceInfo from entity to device registry ( #98149 )
...
* Move DeviceInfo from entity to device registry
* Update integrations
2023-08-10 22:04:26 -04:00
Jan Bouwhuis
9c6c391eea
Offer work- a-round for MQTT entity names that start with the device name ( #97495 )
...
Co-authored-by: SukramJ <sukramj@icloud.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-08-01 10:03:08 +02:00
Jan Bouwhuis
3fcfe7d0c6
Set mqtt entity name to null
when it is a duplicate of the device name ( #97304 )
2023-07-27 09:23:23 +02:00
Marc Mueller
c0da6b822e
Fix ruff ( #97131 )
2023-07-24 10:34:16 +02:00
Marc Mueller
3371c41bda
Improve async_track_device_registry_updated_event
callback typing ( #97125 )
2023-07-24 09:42:01 +02:00
Marc Mueller
0624345322
Improve async_track_entity_registry_updated_event
callback typing ( #97124 )
2023-07-24 09:14:10 +02:00
Jan Bouwhuis
9424d11408
Allow homeassistant in MQTT configuration_url schema ( #96107 )
2023-07-22 22:50:58 +02:00
Jan Bouwhuis
447fbf58c9
Change naming of MQTT entities to correspond with HA guidelines ( #95159 )
...
* Set has_entity_name if device_name is set
* revert unneeded formatting change
* Add image platform
* Follow up comment
* Don't set `has_entity_name` without device name
* Only set has_entity_name if a valid name is set
* Follow device_class name and add tests
* Follow up comments add extra tests
* Move to helper - Log a warning
* fix test
* Allow to assign None as name explictly
* Refactor
* Log info messages when device name is not set
* Revert scene schema change - no device link
* Always set has_entity_name with device mapping
* Always set `_attr_has_entity_name`
* Cleanup
2023-07-21 12:52:10 +02:00
Jan Bouwhuis
b504665b56
Do not override extra_state_attributes property for MqttEntity ( #96890 )
2023-07-21 06:35:58 +02:00
Jan Bouwhuis
7c22225cd1
Allow ADR 0007 compliant schema for mqtt ( #94305 )
...
* Enforce listed entities in MQTT yaml config
* Add tests for setup with listed items
* Fix test
* Remove validator add comment
* Update homeassistant/components/mqtt/__init__.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-07-18 14:29:45 +02:00
Jan Bouwhuis
0134ee9305
Fix incorrect leagacy code tweak for MQTT ( #96812 )
...
Cleanup mqtt_data_updated_config
2023-07-18 10:50:34 +02:00
Jan Bouwhuis
82b9a31ea7
Improve logging of mqtt discovery message errors ( #94491 )
...
* Improve logging on mqtt discovery message errors
* Create shared helper
* Apply suggestion
* Catch base class vol.Invalid
2023-06-12 21:28:28 +02:00
Jan Bouwhuis
661aedde90
Remove MQTT platform schema warnings ( #93785 )
2023-05-31 09:02:48 +02:00
J. Nick Koston
3db59908ca
Switch mqtt to use async_track_device_registry_updated_event ( #93603 )
2023-05-29 09:43:01 -05:00