Jan Bouwhuis
21affac571
Rename mqtt mixins module to entity.py
( #126279 )
2024-09-19 20:50:33 +02:00
Jan Bouwhuis
16434b5306
Add command_template option to mqtt switch schema ( #122103 )
2024-07-19 12:10:49 +02:00
J. Nick Koston
811ec57c31
Convert mqtt entity discovery to use callbacks ( #118200 )
2024-05-26 16:12:40 -10:00
J. Nick Koston
039bc3501b
Fix mqtt switch types ( #118193 )
...
Remove unused code, add missing type for _is_on_map
2024-05-26 23:18:07 +02:00
J. Nick Koston
f0b4f4655c
Simplify mqtt switch state message processor ( #118187 )
2024-05-26 10:42:24 -10:00
Jan Bouwhuis
b7f1f805fa
Simplify subscription mqtt entity platforms ( #118177 )
2024-05-26 09:25:54 -10:00
J. Nick Koston
80371d3a73
Reduce duplicate publish code in mqtt ( #118163 )
2024-05-26 01:22:54 -10:00
J. Nick Koston
5d37217d96
Avoid expensive inspection of callbacks to setup mqtt subscriptions ( #118161 )
2024-05-26 01:22:44 -10:00
J. Nick Koston
9be829ba1f
Make mqtt internal subscription a normal function ( #118092 )
...
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-05-25 11:34:24 -10:00
Jan Bouwhuis
fc9f7aee7e
Refactor mqtt callbacks for switch ( #118127 )
2024-05-25 11:17:54 -10: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
Marc Mueller
59a6035d3f
Add empty line after module docstring [j-m] ( #112700 )
2024-03-08 09:01:29 -05: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
ec1b3fe6fb
Do not fail MQTT setup if switches configured via yaml can't be validated ( #102320 )
...
Add switch
2023-10-19 23:04:35 +02:00
Jan Bouwhuis
59a26010ba
Cleanup redundant mqtt entity constructors ( #100939 )
...
* Remove redundant mqtt entity constructors
* Remove unrelated change
* Follow up comment
* Revert changes to mqtt update platform
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-09-26 23:03:11 +02:00
Jan Bouwhuis
8d10cdce4e
Avoid redundant calls to async_ha_write_state in mqtt switch ( #100815 )
...
Avoid redundant calls to async_ha_write_state
2023-09-25 18:06:19 +02:00
Jan Bouwhuis
e3837cd1e0
Use shorthand attr for mqtt assumed_state ( #100241 )
2023-09-12 22:21:13 +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
661aedde90
Remove MQTT platform schema warnings ( #93785 )
2023-05-31 09:02:48 +02:00
Franck Nijhof
800b8abe39
Code styling tweaks to the MQTT integration ( #85463 )
2023-01-08 22:07:10 +01:00
Jan Bouwhuis
ee21bc5d7f
Allow MQTT device_class or state_class to be set as None
( #85106 )
...
* Allow MQTT device_class to be set as `None`
* Add test
* Also allow sensor state_class to be `None`
2023-01-04 15:21:07 +01:00
Jan Bouwhuis
9cf86b234b
Add optimistic option for MQTT climate ( #84777 )
2023-01-02 11:39:42 +01:00
Jan Bouwhuis
4335b0db25
Clean up or correct from removed deprecation for MQTT platform ( #82684 )
...
Clean up or correct from removed deprecation
2022-11-25 16:11:22 +01:00
Jan Bouwhuis
7c2e7863d2
Remove legacy YAML support from MQTT ( #82102 )
2022-11-17 22:55:31 +01:00
Jan Bouwhuis
4293c88fb6
Improve MQTT type hints part 6 ( #81001 )
...
* Improve typing siren
* Improve typing switch
* Set siren type hints at class level
* Set switch type hints at class level
* Follow up comment
* Improve hints on siren templates
* Another cleanup for siren
* Follow up comment
* Follow up comment
2022-11-08 13:11:45 +01:00
epenet
a255546e9d
Use attr in mqtt binary sensor and switch ( #81403 )
2022-11-02 13:41:14 +01:00
Jan Bouwhuis
8aa30cce26
Fix state saving when sharing topics for MQTT entities ( #79421 )
...
* Do not write old state sharing availability topic
* Add a test
* Support for all availability topics
* delay async_write_ha_state till last callback
* Process write req after processing callback jobs
* Do not count subscription callbacks
* Simplify
* Stale docsting
* No topic needed for delays state write
* No need to clear when reloading
* Move test to test_mixins.py
* Only set up sensor platform for test
2022-10-11 10:49:54 +02:00
Jan Bouwhuis
354411feed
Link manually added MQTT entities the the MQTT config entry ( #78547 )
...
Co-authored-by: Erik <erik@montnemery.com>
2022-09-18 12:55:31 -04:00
Jan Bouwhuis
5930f056a8
Mqtt support config_entry unload ( #70149 )
...
* squashed commits for rebase
* Flake
* Fix reloading issue manual legacy items
* Improve ACS sync for unsubscribe at disconnect
* Processed review comments
* Update homeassistant/components/mqtt/client.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* No need to await entry setup
* Remove complication is_connected
* Update homeassistant/components/mqtt/__init__.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-07-12 11:07:18 +02:00
epenet
64bfa20f6a
Improve type hints in mqtt ( #74295 )
2022-07-02 20:15:54 +03:00
Erik Montnemery
f05b4a0ca0
Fire event_mqtt_reloaded only after reload is completed ( #74226 )
2022-06-30 10:15:25 -07:00
Jan Bouwhuis
57daeaa174
Fix MQTT config schema to ensure correct validation ( #73619 )
...
* Ensure config schema validation
* Use correct schema for device_tracker
* Remove schema validation from the platform setup
* Remove loop to build schema
2022-06-20 08:51:12 +02:00
Erik Montnemery
b97d346df7
Fix reload of MQTT yaml config ( #72901 )
2022-06-02 11:32:31 -07:00
Erik Montnemery
635d7085cf
Move MQTT config schemas and client to separate modules ( #71995 )
...
* Move MQTT config schemas and client to separate modules
* Update integrations depending on MQTT
2022-05-31 09:32:44 +02:00
Jan Bouwhuis
87d895929f
Move manual configuration of MQTT switch to the integration key ( #72279 )
...
Add switch
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-05-22 13:06:49 +02:00
Paulus Schoutsen
69fcce3b2c
Remove energy usage from the switch base class ( #68821 )
...
* Remove energy usage from the switch base class
* Remove unused attributes from integrations
2022-03-28 18:56:04 -10:00
Erik Montnemery
fe38e6ba87
Drop MQTT import flow ( #66160 )
...
* Drop MQTT import flow
* Reload manually configured MQTT entities when config entry is setup
* Address review comments
* Actually remove the import flow
2022-02-10 21:09:57 +01:00
Jan Bouwhuis
678e56b8b7
Mqtt move to .const ( #65631 )
2022-02-10 09:18:35 +01:00
Erik Montnemery
8245ff7473
Log transmitted MQTT messages ( #65550 )
2022-02-04 17:35:32 +01:00
Jan Bouwhuis
3d434dffc7
Add support Mqtt switch for unkown state ( #65294 )
...
* Mqtt switch allow unkown state
* correct type
* Update discovery tests
* Optimistic mode if not state_topic is configured.
* Default state UNKNOWN in optimistic mode
* fix discovery test
2022-02-03 16:47:24 +01:00
Erik Montnemery
f3a89de71f
Fix race when handling updated MQTT discovery data ( #65415 )
2022-02-02 17:12:22 -08:00
Jan Bouwhuis
dd0193052c
Add MQTT encoding parameter for all subscribed topics ( #62263 )
...
* Add encoding parameter for all subscribable topics
* test setup encoding incoming payload
* remove support for device_tracker and tag+tests
2022-01-03 16:08:07 +01:00
Jan Bouwhuis
3ca18922e6
Mqtt rework on value templates ( #62105 )
...
* add MqttValueTemplate class
* support variables at initiation
* pass MqttEntity instead of hass
* Use MqttValueTemplace class for value templates
* make hass en enitity parameters conditional
* remove unused property and remove None assignment
* rename self._attr_value_template
2022-01-03 16:07:40 +01:00
Jan Bouwhuis
d0c4f0fec4
Add mqtt encoding support for publishing ( #62739 )
...
* encoding support for mqtt publishing - todo tests
* signature allows None values for qos and retain
* common test for mqtt publishing encoding
* better test with command templates
* more tests
* fix tests alarm control panel+tests light basic
* tests light json and template
* add tests vacuum and fix tests light_template
2022-01-03 09:03:47 +01:00
epenet
2cc4d9846b
Add basic type hints to mqtt ( #62875 )
...
* Add basic type hints to mqtt
* Add hints to async_setup_platform
* Add type hint to async_setup_entry
* Fix pylint
* Set correct argument order in climate entity
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-03 08:53:52 +01:00
Damien Duboeuf
67c2747027
Add MQTT object_id option ( #58728 )
...
* Add MQTT object_id option
* Add MQTT object_id option
* Add MQTT object_id option
* Add MQTT object_id option - Fix light and vacuum
* Add MQTT object_id option - Fix light and vacuum
* Add MQTT object_id option - Fix lock
* Add MQTT object_id option - Fix device
* Add MQTT object_id option - Fix device
* Update tests/components/mqtt/test_discovery.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Change deprecated method
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-11-08 14:02:18 +01:00
Chris Browet
2df1ba2346
Add device_class to MQTT switch ( #58931 )
2021-11-02 17:40:05 +01:00
Marc Mueller
887d04be60
Use assignment expressions 32 ( #58716 )
2021-10-30 16:30:13 +02:00
Erik Montnemery
0456a896e3
Avoid service call in MQTT async_publish function ( #58441 )
...
* Avoid service call in MQTT async_publish function
* Tweak
* Fix integrations + tests
2021-10-28 08:13:32 +02:00
Erik Montnemery
640a7fee9d
Allow extra keys in MQTT discovery messages ( #58390 )
...
* Allow extra keys in MQTT discovery messages
* Remove extra keys
2021-10-25 13:47:06 +02:00