Commit graph

168 commits

Author SHA1 Message Date
Erik Montnemery
bc5f0ff0b3 Use dict[key] for required config keys and keys with default values of MQTT light ()
* Use dict[key] for required config keys and keys with default values.

* Improve tests

* Lint

* Improve tests of JSON data
2019-04-10 11:16:41 +02:00
Paulus Schoutsen
590eead128
Test fixes ()
* Fix light tests [skip ci]

* Fix tests/common

* Fix some mqtt tests [skip ci]

* Fix tests and component manifests which have only one platform

* Fix more tests and manifests

* Fix demo/notify tests

* Rollback test for demo.geo_location
2019-04-08 23:16:55 -07:00
Otto Winter
c9ec166f4b Add MQTT climate two-point target temperature support ()
* Add MQTT climate two-point target temperature support

* Sort

* Fix test
2019-04-08 06:28:42 -07:00
Kyle Niewiada
a5a926bcc6 Raise ConfigEntryNotReady for MQTT connection exception ()
* Raise ConfigEntryNotReady for connection exception

Raise ConfigEntryNotReady for the connection exception like if the MQTT Server container/device is being restarted or was unavailable on boot.

* Add new exception

* grammar fix

* Possibly resolve hound comments

* raise `ConfigEntryNotReady` for mqtt connection error

* revert exceptions.py

* Update exceptions.py

* modify test to handle exception

* use constants to control exception scope

* Raise ConfigEntryNotReady for connection exception

Raise ConfigEntryNotReady for the connection exception like if the MQTT Server container/device is being restarted or was unavailable on boot.

* Add new exception

* Add new exception

* grammar fix

* Possibly resolve hound comments

* raise `ConfigEntryNotReady` for mqtt connection error

* revert exceptions.py

* Update exceptions.py

* modify test to handle exception

* use constants to control exception scope

* revert test change as it's not the same thing

* Update test_init.py

* Add test for MQTT OSError

* revert file changes from a bad rebase

* Rewrite test with valid syntax

* rewrite test to be less ambiguous

* add empty line

* add back 'axis'

* Remove empty line

* Update tests and undo merge from earlier

* correctly restore test for no connect broker

* fix test mock correctly

* line was too long. hit enter.
2019-04-03 21:51:01 -07:00
Kevin Cooper
4b9e3258dc Add command_template and value_template for MQTT alarm ()
* Option to send pin code with the MQTT payload for MQTT alarm

* publish code via json

Add publish code via json
add code_disarm_required

* publish code via json

Add publish code via json
add code_disarm_required

* implemented command_template

* Fix issue with night arm and add template test

* implemented value_template for mqtt alarm

* Fixed merge errors

* Requested changes

* Resolve lint errors

* Resolve hound issues

* Fix test formatting
2019-03-30 07:36:10 +01:00
emontnemery
5957e4b75b Pass Message object to MQTT message callbacks ()
* Pass Message object to MQTT message callbacks

* Improve method of detecting deprecated msg callback

* Fix mysensors

* Fixup

* Review comments

* Fix merge error
2019-03-13 12:58:20 -07:00
emontnemery
ce1fe06193 Write state directly in all MQTT platforms () 2019-03-12 14:46:48 -07:00
Paulus Schoutsen
429bbc05dc
Add WS subscription command for MQTT ()
* Add WS subscription command for MQTT

* Add test

* Add check for connected

* Rename event_listeners to subscriptions
2019-03-10 20:07:09 -07:00
Jason Hu
fe1840f901 Deprecate http.api_password ()
* Deprecated http.api_password

* Deprecated ApiConfig.api_password

GitHub Drafted PR would trigger CI after changed it to normal PR.
I have to commit a comment change to trigger it

* Trigger CI

* Adjust if- elif chain in auth middleware
2019-03-10 19:55:36 -07:00
Marco M
05333f60d7 Fix missing code_required check in async_alarm_arm_night ()
* Fix missing code_required check in async_alarm_arm_night

* Remove double code validation
Test added
2019-03-10 14:25:01 +01:00
Marco M
c3d4738649 Mqtt alarm added value_template and code_arm_required ()
* Added value_template config for parsing json value from state topic

Added arm_code_required to avoid code enter when arming

* Renamed config parameter to code_arm_required

* Fix for discovery update compatibility

* Fixed lint error

* Added test
2019-02-28 17:44:23 +01:00
Joakim Plate
c5de32e7b1 Climate const.py move ()
* Move constants to const.py

* Import from const instead of climate
2019-02-14 20:34:43 +01:00
Ryan Wagoner
62b2b23d0b Add night arm mode to MQTT alarm control panel ()
* Add night arm mode to MQTT alarm control panel

* Add unit test for MQTT alarm night mode
2019-02-13 22:52:32 +01:00
emontnemery
22af9707ad Add support for device_class to MQTT cover () 2019-02-13 19:58:46 +00:00
emontnemery
5f7f7777a0 Fix encoding for MQTT camera () 2019-02-10 12:35:54 +01:00
emontnemery
b1faad0a50 Use PLATFORM_SCHEMA_BASE as base schema for additional components. ()
* Disable extra=vol.ALLOW_EXTRA for additional platforms.

* Remove PLATFORM_SCHEMA_2

* Add entity_namespace to base platform schema
2019-02-04 21:52:19 -08:00
emontnemery
79d3f533a9 Add missing abbreviations () 2019-02-04 10:54:40 -08:00
Jason Hu
d7b61f7ff6 Move mqtt_mock to tests/components/mqtt/conftest.py ()
* Move mqtt_mock to tests/components/mqtt/conftest.py

* Move mqtt room presence sensor test to tests/components/mqtt

* Revert "Move mqtt room presence sensor test to tests/components/mqtt"

This reverts commit e08bc143

* Decouple mqtt room presence sensor test and mqtt_mock
2019-01-31 21:22:29 +01:00
emontnemery
89fc3b2a1b Disable extra=vol.ALLOW_EXTRA for MQTT platforms. () 2019-01-29 09:29:02 -08:00
emontnemery
3ee3acd550 Update device registry of MQTT light ()
* Update device registry of MQTT light

* Move config_entry to constructor
2019-01-28 19:45:34 -08:00
emontnemery
bb1583c453 Add discovery update support to MQTT camera () 2019-01-28 16:21:38 -08:00
emontnemery
bb4ca1f525 Cleanup if discovered mqtt vacuum can't be added () 2019-01-28 15:56:47 -08:00
emontnemery
648adcc708 Small cleanup of MQTT platforms ()
* Move CONF_UNIQUE_ID to init

* Sort imports

* Update ordering
2019-01-27 18:54:52 +01:00
emontnemery
8804f55fcc Update device registry of MQTT Vacuum () 2019-01-27 17:43:16 +01:00
emontnemery
1f93984fd5 Update device registry of MQTT Lock () 2019-01-27 17:42:45 +01:00
emontnemery
60dc337f3f Update device registry of MQTT cover ()
* Update device registry of MQTT cover

* Move config_entry to constructor
2019-01-26 10:52:41 -08:00
emontnemery
85c72fbca6 Update device registry of MQTT alarm () 2019-01-26 10:48:35 -08:00
emontnemery
85ccd71d39 Update device registry of MQTT sensor () 2019-01-26 10:48:18 -08:00
Paulus Schoutsen
09cbcb74bc
Merge pull request from emontnemery/mqtt_binary_sensor_update_device_info
Update device registry of MQTT binary_sensor
2019-01-26 10:47:57 -08:00
Paulus Schoutsen
0e453fe492
Update device registry of MQTT climate () 2019-01-26 10:47:29 -08:00
emontnemery
1d16bb2cd4 Update device registry of MQTT fan () 2019-01-26 10:46:41 -08:00
emontnemery
6d2e7db123 Update device registry of MQTT climate 2019-01-26 09:04:02 +08:00
emontnemery
d8e43978b7 Update device registry of MQTT binary_sensor 2019-01-26 08:58:08 +08:00
emontnemery
d84cd01cbf Cleanup if discovered mqtt light can't be added ()
* Cleanup if discovered mqtt light can't be added

* No bare except

* Clear ALREADY_DISCOVERED list with helper

* Use constant instead of string literal
2019-01-24 22:40:52 -08:00
emontnemery
a1da6a677a Update device registry of MQTT Switch ()
* MQTT Switch: Update device registry

* Move config_entry to constructor

* Remove duplicated code

* Fix merge error
2019-01-24 22:39:16 -08:00
emontnemery
3fcbcd5a38 Add JSON attribute topic to MQTT alarm () 2019-01-20 16:42:56 -08:00
emontnemery
dbba3eb0d4 Add JSON attribute topic to MQTT climate () 2019-01-20 16:42:35 -08:00
emontnemery
89e9d827a2 Add JSON attribute topic to MQTT fan () 2019-01-20 16:42:17 -08:00
emontnemery
ab4e4787e3 Add JSON attribute topic to MQTT lock () 2019-01-20 16:41:50 -08:00
Erik
5b8f64093b Add JSON attribute topic to MQTT vacuum 2019-01-19 11:58:21 +01:00
emontnemery
6800871c13 Log exceptions thrown by signal callbacks ()
* Log exceptions thrown by signal callbacks

* Fix unsub

* Simplify traceback print

* Typing

* Add test

* lint

* Review comments

* Rework MQTT test case

* Fix bad merge

* Fix bad merge
2019-01-17 14:44:57 -08:00
emontnemery
f094a7369d Add JSON attribute topic to MQTT switch () 2019-01-17 10:55:22 -08:00
emontnemery
234f348ba1 Add JSON attribute topic to MQTT light () 2019-01-17 10:54:22 -08:00
emontnemery
d1c6eb4f3e Add JSON attribute topic to MQTT cover ()
* Add JSON attribute topic to MQTT cover

* Lint
2019-01-17 10:53:52 -08:00
emontnemery
368682647d Log exceptions thrown by MQTT message callbacks ()
* Log exceptions thrown by MQTT message callbacks

* Fix tests

* Correct method for skipping wrapper in traceback

* Lint

* Simplify traceback print

* Add test

* Move wrapper to common helper function

* Typing

* Lint
2019-01-16 13:50:21 -08:00
emontnemery
5b53bd6aa0
Move MQTT platforms under the component ()
* Move MQTT platforms under the component
2019-01-15 17:31:06 +01:00
Fredrik Erlandsson
b9a488912a Add support for 'via_hub' for device_info ()
* Add support for 'via_hub'

* Update config schema

* add domain to via_hub

* add tests for via_hub
2019-01-11 13:11:13 -08:00
Paulus Schoutsen
df21dd21f2 RFC: Call services directly ()
* Call services directly

* Simplify

* Type

* Lint

* Update name

* Fix tests

* Catch exceptions in HTTP view

* Lint

* Handle ServiceNotFound in API endpoints that call services

* Type

* Don't crash recorder on non-JSON serializable objects
2018-11-30 21:28:35 +01:00
emontnemery
de9bac9ee3 Reconfigure MQTT binary_sensor component if discovery info is changed ()
* Recreate component if discovery info is changed

* Update component instead of remove+add

* Set name and unique_id in __init__

* Update unit test

* Cleanup

* More cleanup

* Refactor according to review comments

* Change discovery_hash

* Review comments, add tests

* Fix handling of value_template
2018-11-19 16:49:04 +01:00
Pascal Vizeli
eb0d989c88
Bugfix discovery (delete/mqtt) call for Hass.io ()
* Bugfix discovery delete call for Hass.io

* Fix host

* fix tests
2018-11-04 12:19:04 +01:00