* Fix MQTT retained message not being re-dispatched
* Fix tests
* Use paho-mqtt for retained messages
* Improve code style
* Store list of subscribers
* Fix lint error
* Adhere to Home Assistant's logging standard
"Try to avoid brackets and additional quotes around the output to make it easier for users to parse the log."
- https://home-assistant.io/developers/development_guidelines/
* Add reconnect tests
* Fix lint error
* Introduce Subscription
Tests still need to be updated
* Use namedtuple for MQTT messages
... And fix issues
Accessing the config manually at runtime isn't ideal
* Fix MQTT __init__.py tests
* Updated usage of Mocks
* Moved tests that were testing subscriptions out of the MQTTComponent test, because of how mock.patch was used
* Adjusted the remaining tests for the MQTT clients new behavior - e.g. self.progress was removed
* Updated the async_fire_mqtt_message helper
* ✅ Update MQTT tests
* Re-introduce the MQTT subscriptions through the dispatcher for tests - quite ugly though... 🚧
* Update fixtures to use our new MQTT mock 🎨
* 📝 Update base code according to comments
* 🔨 Adjust MQTT test base
* 🔨 Update other MQTT tests
* 🍎 Fix carriage return in source files
Apparently test_mqtt_json.py and test_mqtt_template.py were written on Windows. In order to not mess up the diff, I'll just redo the carriage return.
* 🎨 Remove unused import
* 📝 Remove fire_mqtt_client_message
* 🐛 Fix using python 3.6 method
What's very interesting is that 3.4 didn't fail on travis...
* 🐛 Fix using assert directly
In local testing py36 always fails on test_minimal_config on a wait
call that never completes. One difference between this test and others
in the class is the lack of a mock on `call`. With this added, the
test passes locally 100%.
* Connection to mochad occasionally stalls on RPi and CM19A. Reconnect one switch send command.
* Formatting and exception hanling fixes
* Moved import inside the method. Logging outside the try-catch.
* Tailing whitespaces.
* MockDependency on pymochad in unit tests to resolve exceptions
* patch pymochad MochadException in unit tests to resolve exceptions
* patch pymochad MochadException in unit tests to resolve exceptions
* cleaned unused import
* lint issue fixed
* pylint issue fixed
* Initial commit of Vultr components
Have a working Vultr hub and binary sensor which pulls down the
following attributes of your VPS:
- Date created
- Subscription id (server id)
- Cost per month (in US$)
- Operating System installed
- IPv4 address
- label (human readable name)
- region
- number of vcpus
- which storage package chosen
- IPV6 address (if applicable)
- RAM amount
Working next on sensor and then testing / coverage.
* Added Vultr sensor for pending charges and current bandwidth. Refactored binary_sensor and hub too
* Corrected is_on bases
* Added basic tests for Vultr binary & platform
* Updated require files
* Changing test fixture to highlight different cases
* Written basic test for sensor.vultr
* Resolved linting errors and broken test
* Increase test coverage and corrected docs
* Resolved hound issues
* Revert back negative binary test
* Another hound resolve
* Refactoring and adding is switch, moving over to vultr branch
* Made Vultr components more resiliant to invalid configs
* Added negetive test for vultr binary sensor
* Added better testing of vultr sensor
* Resolved vultr platform test affecting subsequent vultr tests
* Moving VULTR components to single use design
* Added in sensor name config
* Added missing sensors var
* Resolved init data setting of sensors, added in name conf to switch
* Made the Vultr component more resiliant to startup failure with better alerting
* Various Vultr component changes
- Refactored sensor, binary_sensor, and switch to reference one subscription
- Renamed CURRENT_BANDWIDTH_GB monitored condition to CURRENT_BANDWIDTH_USED
- Improved test coverage
* Resolved local tox linting issue
* Added more testing for Vultr switch
* Improved test coverage for Vultr components
* Made PR comment changes to vultr binary sensor
* Made PR comment changes to Vultr sensor
* resolved PR comments for Vultr Switch
* Resolved vultr sensor name and improved tests
* Improved Vultr switch testing (default name formatting)
* Removed vultr hub failure checking
* Add HTTP Basic auth to RESTful Switch
* Remove redundant hass passing
* Initialize to current state
The state used to be None until the first periodic poll.
This commit refactors async_update so it can be used during setup as well,
allowing the state to start out with the correct value.
* Refactor turn_on/turn_off device communication
* Remove lint
* Fix Travis errors
* flux: fix for when stop_time is after midnight
* flux: fix imports
* flux: add missing check when now is after midnight
* flux: one more try; should fix all use cases now
* flux switch: fix lint
* flux switch: add new tests
* flux switch: fix tests lint
* flux switch: fix tests docstrings
* No longer require pyunify during tests
* No longer require cast during tests
* No longer required dependency for tests
* No longer require pymochad for tests
* Astral is a core dependency
* Avoid having to install datadog dependency during tests
* CMUS test doesn't test anything
* Frontier Silicon doesn't test anything
* No longer require mutagen
* Update requirements_test_all.txt
* Remove stale comment
* Refactor sun component for correctness
* Convert datetimes to dates for astral
* Fix tests for updated code
* Fix times now that calcs are fixed
* Move sun functions to helpers
* Fix flake on new file
* Additional tweaks from review
* Update requirements
* Migrate mqtt to async
* address paulus comment / convert it complet async
* adress paulus comment / remove future
* Automation triggers should be async
* Fix MQTT async calls
* Show that event helpers are callbacks
* Fix tests
* Lint
* Initial sketches of rflink component.
* Add requirement.
* Properly load configuration.
* Bump rflink for graceful parse errors and protocol callback.
* Cleanup, documentation and linting.
* More documentation, first sensor implementation (temp & hum).
* Add brightness/dim support for newkaku protocol.
* Use separate class for dimmables.
* Make sure non-dimmable newkaku devices are turned on.
* Move some code around, add switches. Support loading from config.
* Fix bug in ignoring devices.
* Fix initial state assumption.
* Improve reliability on invalid conditions.
* Allow configuration of group for new devices.
* Sensor icons.
* Fix parsing negative numbers.
* Correct icon.
* Allow sending commands serial.
* Pluralize.
* Allow adding sensors from config.
* Fix ignoring devices and bugs in previous commit.
* Share know devices so devices from configuration don't get added as lights.
* Lookup unit from value_key.
* Remove debug.
* Start implementing event protocol in place of packet protocol.
- Added first test suite for sensors.
- This currently breaks light and switch.
* Refactor switch component to fit new rflink changes. Add test suite.
* Fix style.
* Refactor and test lights. Bring coverage to 100%.
* Use non-broken and production tested rflink module.
* Update requirements.
* Bump for logging.
* Improve readability.
* Do not use global variable but keep known device state in intended place.
* Improve docs.
* Make icon support generic.
* Disable overriding icons in config, as it belongs in customization. Only keep custom icon for entities that are able to detect a icon based on the thing they represent (sensors in this case).
* Implement configuration schema, overall refactor of magic values.
* Fix bug in config/test wait_for_ack.
* Small refactors.
* Move command logic into separate class.
* Convert command sending logic to class based pattern instead of using the event bus.
* Start not using bus for rflink event propagation to platforms.
* Do not use event bus for all entity types.
* Fire an event on the bus for every switch incoming rflink command.
* Resolve lint errors, remove some old code.
* Known devices no longer need to be registered separately.
* Log bus events.
* Event callback is a..... callback.
* Use full entity id for events.
* Move event sending to entity.
* Log incoming events.
* Make firing events optional inline with rfxtrx.
* Add foundation for signal repetition.
* Add signal repetition config and tests.
* Make plain switchable type explicitly configurable.
* Enable default entity settings for automatically added entities as well.
* Prevent default configuration leaking accross entities.
* Make sure device defaults don't get overwritten by defaults further down.
* Don't let fast state switching and repetitions turn your house into a disco.
* Make repetitions more responsive.
* Disable on/off fallback on dimmables as it currently doesn't play nice with repetitions.
* Use rflink that allows send_command_ack to be safely cancelled.
* Reduce duplication and make repeat work for non-ack.
* Implement reconnection logic.
* Improve reconnection logic.
* Also cancel repetitions when entity state is changed due to external command.
* Update requirements.
* Fix linting.
* Fix spelling.
* Don't lie.
* Fix lint.
* Support for automatically creating protocol translation (fixes spaces in device names).
* Returned support for dimmable and on/off entity.
* Duplicate code to fix linting issues with inheritance.
* Allow overriding unit of measurement from config.
* LiteJet: Unit tests and new trigger options held_more_than and held_less_than.
* Unit tests for the LiteJet component and associated platforms. Coverage is almost 100% -- just misses one line.
* The automation LiteJet trigger returns an empty "removal" function to ensure the automation base is happy with it. The pylitejet library doesn't actually support a real removal.
* The automation LiteJet trigger can detect hold time and act appropriately to support things like short tap or long hold.
* LiteJet: Fix indent in unit test source code.
* LiteJet: Fix test_include_switches_* unit tests on Python 3.5
* LiteJet: Remove wait for state existence from unit tests. Recent fixes to discovery make this no longer necessary.
* Migrate callbacks to use schedule_update_ha_state
* Migrate MQTT sensor callback to async
* Migrate wemo to not update inside schedule_update_ha_state
* Make MQTT switch async
* Fix nx584 test
* Migrate tellstick callback
* Migrate vera callback
* Alarm control panel - manual: use async callbacks
* Run the switch rest tests that work
* Use entity_id for backend, friendly name for frontend
Closes https://github.com/home-assistant/home-assistant/issues/3434
Command line switches had the option to set a `friendly_name` reportedly
for use in the front end. However, if set, it was also being used as the
`entity_id`.
This did not seem like obvious behavior to me. This PR changes the
behavior so the entity_id is the object_id, which must already be
unique, and is an obvious place to have a very predictable slug (even if
long or unsightly), and the friendly name (if set) is used for the
display.
Example:
```yaml
switch:
platform: command_line
switches:
rf_kitchen_light_one:
command_on: switch_command on kitchen
command_off: switch_command off kitchen
command_state: query_command kitchen
value_template: '{{ value == "online" }}'
friendly_name: "Beautiful bright kitchen light!"
```
If you were using in an automation or from dev tools, would use:
`switch.rf_kitchen_light_one`, but your front end would still show `Beautiful
bright kitchen light!`
* Add new arg to test_assumed_state_should_be_true_if_command_state_is_false
* Import ENTITY_ID _FORMAT from existing, rename device_name to object_id
* Rename `device_name` to `object_id`
* Test that `entity_id` and `name` are set as expected
* Lazy initialise the worker pool
* Minimize pool initialization in core tests
* Fix tests on Python 3.4
* Remove passing in thread count to mock HASS
* Tests: Allow pool by default for threaded, disable for async
* Remove JobPriority for thread pool
* Fix wrong block_till_done
* EmulatedHue: Remove unused test code
* Zigbee: do not touch hass.pool
* Init loop in add_job
* Fix core test
* Fix random sensor test
This commit adds a new component for communicating with mochad[1] a
socket interface for the CM15A and CM19A USB X10 controllers. This
commit leverages the pymochad library to interface with a mochad socket
either on a local or remote machine. Mochad is added as as a generic
platform because it supports multiple different classes of device,
however in this patch only the switch device implemented as a starting
point. Future patches will include other devices types. (although
that's dependent on someone gaining access to those)
[1] https://sourceforge.net/projects/mochad/
If a mock's assert_called_once_with method is misspelled (e.g. asert_called_once_with) then the test will appear as passing. Therefore, this commit removes all instances of assert_called_once_with calls and replaces them with two assertions:
self.assertEqual(mock.call_count, 1)
self.assertEqual(mock.call_args, mock.call(call_args))
* Make flux always adjust brightness of light (even when not in XY mode)
* Remove kelvin mode from flux switch
The light/turn_on service only works with mired values, kelvin values
are out of range per the schema.
* Use already defined min/max values for light/turn_on schema
* Clamp temp value to light/turn_on allowed values
* Skip RFXtrx tests unless RFXTRX=RUN
* Remove my previous hacks to slightly speed up rfxtrx
* Exclude RFXTRX tests from coverage
* Remove unused import in rfxtrx tstt
* Add close connection back to RFXtrx tests
* Typo
* Add event loop to the core
* Add block_till_done to HA core object
* Fix some tests
* Linting core
* Fix statemachine tests
* Core test fixes
* fix block_till_done to wait for loop and queue to empty
* fix test_core for passing, and correct start/stop/block_till_done
* Fix remote tests
* Fix tests: block_till_done
* Fix linting
* Fix more tests
* Fix final linting
* Fix remote test
* remove unnecessary import
* reduce sleep to avoid slowing down the tests excessively
* fix remaining tests to wait for non-threadsafe operations
* Add async_ doc strings for event loop / coroutine info
* Fix command line test to block for the right timeout
* Fix py3.4.2 loop var access
* Fix SERVICE_CALL_LIMIT being in effect for other tests
* Fix lint errors
* Fix lint error with proper placement
* Fix slave start to not start a timer
* Add asyncio compatible listeners.
* Increase min Python version to 3.4.2
* Move async backports to util
* Add backported async tests
* Fix linting
* Simplify Python version check
* Fix lint
* Remove unneeded try/except and queue listener appproriately.
* Fix tuple vs. list unorderable error on version compare.
* Fix version tests
* Added mired and kelvin mode to flux
* changed as requested
* Renamed varible
* attempt to add test for new method in flux.py
* removed line to fix lint error
* flux platform as a switch
* use track_time_change. broken :(
* use track_utc_time_change instead of track_time_change
* add some basic tests
* use brightness from RGB_to_xy
* config_schema validation
* back to platform schema. what was i doing?
* more broken tests :(
* 644
* fix some time bugs
* add working tests. config validation still not right
* bug fixes and more test cases.