* Add view to support backend translation fetching
* Load backend translations from component json
* Translations for season sensor
* Scripts to merge and unpack Lokalise translations
* Fix copy paste error
* Serve post-lokalise translations to frontend
* Linting
* Auto-deploy translations with Travis
* Commit post-lokalise translation files
* Split logic into more helper functions
* Fall back to English for missing keys
* Move local translation copies to `.translations`
* Linting
* Initial tests
* Remove unnecessary file check
* Convert translation helper to async/await
* Convert translation helper tests to async/await
* Use set subtraction to find missing_components
* load_translation_files use component->file mapping
* Remove duplicated resources fetching
Get to take advantage of the slick Python 3.5 dict merging here.
* Switch to live project ID
* Make color_name_to_rgb raise
* Add Light Set Color intent
* Move some methods around
* Cleanup
* Prevent 1 more func call
* Make a generic Set intent for light
* Lint
* lint
* Upgrade pylint to 1.8.1
* Fix no-else-return
* Fix bad-whitespace
* Fix too-many-nested-blocks
* Fix raising-format-tuple
See https://github.com/PyCQA/pylint/blob/master/doc/whatsnew/1.8.rst
* Fix len-as-condition
* Fix logging-not-lazy
Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string
* Fix stop-iteration-return
* Fix useless-super-delegation
* Fix trailing-comma-tuple
Both of these seem to simply be bugs:
* Nest: The value of self._humidity never seems to be used anywhere
* Dovado: The called API method seems to expect a "normal" number
* Fix redefined-argument-from-local
* Fix consider-using-enumerate
* Fix wrong-import-order
* Fix arguments-differ
* Fix missed no-else-return
* Fix no-member and related
* Fix signatures-differ
* Revert "Upgrade pylint to 1.8.1"
This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.
* Fix arguments-differ
* except for device_tracker
* Cleanup
* Fix test using positional argument
* Fix line too long
I forgot to run flake8 - shame on me... 🙃
* Fix bad-option-value for 1.6.5
* Fix arguments-differ for device_tracker
* Upgrade pylint to 1.8.2
* 👕 Fix missed no-member
* Entity#unique_id defaults to None
* Initial commit entity registry
* Clean up unique_id property
* Lint
* Add tests to entity component
* Lint
* Restore some unique ids
* Spelling
* Remove use of IP address for unique ID
* Add tests
* Add tests
* Fix tests
* Add some docs
* Add one more test
* Fix new test…
The current code relies on the assumption that the first invocation will never specify no_throttle=True.
However that puts us in a pickle when writing unit tests: if we had a fictitious:
def setup_platform():
update()
@Throttle(MIN_TIME_BETWEEN_SCANS)
def update():
pass
Then given multiple tests, the second and some of subsequent tests would be throttled (depending on timing).
But we also can't change that code to call `update(no_throttle=True)' because that's not currently accepted.
This diff shouldn't change the visibile behavior of any component, but allows this extra flexibility.
* Implement adjustment
* Add color support
* fix lint
* Fix lint & use only RGB
* fix HSB + Test
* Add tests & fix bugs
* add rgb test
* add setColorTemperature
* Add color light support + tests
* Fix color temp
* use kelvin for converting
* use correct calculation
* Xiaomi vacuum as component with switch, sensors and services
- Conversion from switch platform to async component.
- Add services proposed in #8416 to the new component, with shorter names.
- Add sensors for the vacuum robot as a selectable list from `battery`, `state`, `error`, `fanspeed`, `clean_time` and `clean_area` (the state attributes of the switch). The sensors don't poll, but listen to a signal to update the state, the switch fires this signal when updating.
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)
* path change in requirements_all (from switch platform to component)
* copy pasting is a bad habit
* services to the components services.yaml, modify .coveragerc
* review: use with multiple hosts, fix calls to async_add_devices, fix ranges for services
* `icon_for_battery_level` util method
* Xiaomi vacuum as platform of new component vacuum
- Created new component `vacuum` from a ToggleEntity.
- Add services `turn_on`, `turn_off`, `cleaning_play_pause`, `stop`, `return_to_base`, `locate`, `set_fanspeed` and `send_command`.
- Remove the main switch for the xiaomi vacuum (the toggable main entity is the switch).
- Add `support flags` for the common services
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)
- Move services descriptions to a yaml file for the new component.
- Update requirements_all.
- Update coveragerc.
* fix coveragerc
* fix battery icon helper to use more icons
* remove sensors, create properties and support flags for custom UI
* cleaning
* updated state_attrs for filtering in UI, renamed platform to simply `xiaomi`
* fix platform rename
* change fanspeed and expose `fanspeed_list` to use speed steps
* minor fixes
- Rename service `start_pause`
- Add 'Error' attribute only if `got_error`.
- Minor changes
* rename state attrs
* rename state attrs
* review changes: cut fan__speed, style changes, remove logging, and more
* add ATTR_COMMAND = 'command' to const
* pop entity_id from service data
* remove property accessor for vacuum object
* lint fix
* fix extra attrs names
* module level functions for calling the services
* params as optional keyword for `send_command`
* params as optional keyword for `send_command`, remove debug logs
* explicit parameters for `set_fan_speed` and `send_command`
* Demo platform for the vacuum component
* vacuum tests for the Demo platform
* some fixes
* don't omit vacuum
* vacuum tests for the Xiaomi platform
* fix test
* fix
* fix xiaomi test
* fix coveragerc
* test send command
* fix coveragerc
* fix string formatting
* The coverage is to low. It need 93% or more
* Use pip install --user if venv not active
* Set PYTHONUSERBASE to deps directory, when installing with --user
option.
* Reset --prefix option to workaround incompatability when installing
with --user option. This requires pip version 8.0.0 or greater.
* Require pip version 8.0.3.
* Do not delete deps directory on home assistant upgrade.
* Fix local lib mount and check package exist.
* Update and add tests
* Fix upgrade from before version 0.46
* Extract function to get user site
* Add function(s) to package util to get user site.
* Use async subprocess for one of the functions to get user site.
* Add function to package util to check if virtual environment is
active.
* Add and update tests.
* Update version for last removal of deps dir
* Address comments
* Rewrite package util tests with pytest
* Rewrite all existing unittest class based tests for package util as
test functions, and capitalize pytest fixtures.
* Add test for installing with target inside venv.
* Add color_util.color_hsv_to_RGB
* Use helper functions for LIFX conversions
The LIFX API uses 16 bits for saturation/brightness while HA uses 8 bits.
Using helper functions makes the conversion a bit nicer and less prone
to off-by-one issues.
The colorsys library uses 0.0-1.0 but we can avoid that by using the HA
color_util converters instead.
* Remove global limit on white light temperature
Here are the supported temperatures of some popular bulbs:
Philips Hue: 2000K-6500K (the current 500-154 mired range)
LIFX Color 1000: 2500K-9000K
IKEA TRÅDFRI: 2200K, 2700K, 4000K
Obviously, Home Assistant cannot enforce a global limit and work properly
with all of these bulbs. So just remove the limit and leave it up to each
platform to work it out.
This commit updates the existing users and adds a clamp to Hue (where the
limit appears to have originated). It does not attempt to update other
platforms that might need extra handling of the larger range that is now
possible.
* Add min_mireds/max_mireds state attributes to lights
* Support min_mireds/max_mireds with LIFX lights
This makes more sense because the input and output brightness is the same.
We currently convert through RGB which does contain a brightness so we supply
an arbitrary value as input and discard the output.
* After rebase and all fixes
* Added color_rgb_to_hex to util.color
* Added test_color_rgb_to_hex
* Changed reference to color_rgb_to_hex
* Bumped to pytradfri 0.5, having support for retry
* Bumped to pytradfri 0.5, having support for retry
* Bumped to pytradfri 0.5, having support for retry
* Bumped to pytradfri 0.5, having support for retry
* Rolled back to 0.4
* Rolled back to 0.4
When the user exceeds the request limit for google APIs, the response status stays at 200 but the response body is different:
```
{
"error_message" : "You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_",
"results" : [],
"status" : "OVER_QUERY_LIMIT"
}
```
This prevents HA from creating the initial configuration
* Update to Current RGB D65 Conversion
As per Philips Hue https://developers.meethue.com/documentation/color-conversions-rgb-xy
* Update the source of the XYZ to RGB formulas
* Fix Whitespace
* Update Whitespace
* Update Tests for new Formulas
* Update Tests
* Update XY_Brightness_to_hsv tests
* Update test_color.py
* Fix for OSRAM lights connected to hue bridge
Do not send command "effect = none" to OSRAM lights
Osram lights connected to a hue bridge do not seem to handle "effect =
none" very well. Most of the times they jump to the selected color and
then change to red within a second.
Osram lights connected to a hue bridge do not handle xy values outside
of their gamut. Since they just stay at their old color value, handling
the UI is very unpredictable. Sending HSV values to the lights fixes this.
* Add tests for new util methods
* Expose isort preferences for tools.
* Adhere to pylints sorted imports requirement.
* More documentation, set typing in between stdlib and 3rd party.
* Move HTTP to own folder
* Break HTTP into middlewares
* Lint
* Split tests per middleware
* Clean up HTTP tests
* Make HomeAssistantViews more stateless
* Lint
* Make HTTP setup async
* Climate: more consistent units
* Prevent unnecessary conversion in entity component
* int -> round
* Disable Google tests because they connect to the internet
* Remove default conversion rounding F->C
* Add rounding of temp to weather comp
* Fix equality
* Maintain precision when converting temp in entity
* Revert "Disable Google tests because they connect to the internet"
This reverts commit b60485dc19.
* 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
* Move worker pool monitoring to be time based instead of add_job based.
* Stub out worker pool monitor during tests
* Add test for monitor worker pool.
* Improve naming
* Test stop_monitor coroutine
* Add async_create_timer test
* Finish rename create_timer
* 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
* Move secret cache out of loader so it can be referenced by other folders
* Unit test to verify secrets from another folder work & see if it overrides parent secret
* Clear secret cache after load
* Fix log message for deprecated temp key
* Use string formatting and pass constant variables as arguments in log
message to show correct name of config keys.
* Fix import order
* Fix: Circular dependencies of internal files
* Change: dt.date for Date and dt.datetime for DateTime
* Use NewType if available
* FIX: Wrong version test
* Remove: Date and DateTime types due to error
* Change to HomeAssistantType
* General Improvement of Typing
* Improve typing config_validation
* Improve typing script
* General Typing Improvements
* Improve NewType check
* Improve typing db_migrator
* Improve util/__init__ typing
* Improve helpers/location typing
* Regroup imports and remove pylint: disable=ungrouped-imports
* General typing improvements
Add unit symbol constants
Initial unit system object
Import more constants
Pydoc for unit system file
Import constants for configuration validation
Unit system validation method
Typing for constants
Inches are valid lengths too
Typings
Change base class to dict - needed for remote api call serialization
Validation
Use dictionary keys
Defined unit systems
Update location util to use metric instead of us fahrenheit
Update constant imports
Import defined unit systems
Update configuration to use unit system
Update schema to use unit system
Update constants
Add imports to core for unit system and distance
Type for config
Default unit system
Convert distance from HASS instance
Update temperature conversion to use unit system
Update temperature conversion
Set unit system based on configuration
Set info unit system
Return unit system dictionary with config dictionary
Auto discover unit system
Update location test for use metric
Update forecast unit system
Update mold indicator unit system
Update thermostat unit system
Update thermostat demo test
Unit tests around unit system
Update test common hass configuration
Update configuration unit tests
There should always be a unit system!
Update core unit tests
Constants typing
Linting issues
Remove unused import
Update fitbit sensor to use application unit system
Update google travel time to use application unit system
Update configuration example
Update dht sensor
Update DHT temperature conversion to use the utility function
Update swagger config
Update my sensors metric flag
Update hvac component temperature conversion
HVAC conversion for temperature
Pull unit from sensor type map
Pull unit from sensor type map
Update the temper sensor unit
Update yWeather sensor unit
Update hvac demo unit test
Set unit test config unit system to metric
Use hass unit system length for default in proximity
Use the name of the system instead of temperature
Use constants from const
Unused import
Forecasted temperature
Fix calculation in case furthest distance is greater than 1000000 units
Remove unneeded constants
Set default length to km or miles
Use constants
Linting doesn't like importing just for typing
Fix reference
Test is expecting meters - set config to meters
Use constant
Use constant
PyDoc for unit test
Should be not in
Rename to units
Change unit system to be an object - not a dictionary
Return tuple in conversion
Move convert to temperature util
Temperature conversion is now in unit system
Update imports
Rename to units
Units is now an object
Use temperature util conversion
Unit system is now an object
Validate and convert unit system config
Return the scalar value in template distance
Test is expecting meters
Update unit tests around unit system
Distance util returns tuple
Fix location info test
Set units
Update unit tests
Convert distance
DOH
Pull out the scalar from the vector
Linting
I really hate python linting
Linting again
BLARG
Unit test documentation
Unit test around is metric flag
Break ternary statement into if/else blocks
Don't use dictionary - use members
is metric flag
Rename constants
Use is metric flag
Move constants to CONST file
Move to const file
Raise error if unit is not expected
Typing
No need to return unit since only performing conversion if it can work
Use constants
Line wrapping
Raise error if invalid value
Remove subscripts from conversion as they are no longer returned as tuples
No longer tuples
No longer tuples
Check for numeric type
Fix string format to use correct variable
Typing
Assert errors raised
Remove subscript
Only convert temperature if we know the unit
If no unit of measurement set - default to HASS config
Convert only if we know the unit
Remove subscription
Fix not in clause
Linting fixes
Wants a boolean
Clearer if-block
Check if the key is in the config first
Missed a couple expecting tuples
Backwards compatibility
No like-y ternary!
Error handling around state setting
Pretty unit system configuration validation
More tuple crap
Use is metric flag
Error handling around min/max temp
Explode if no unit
Pull unit from config
Celsius has a decimal
Unused import
Check if it's a temperature before we try to convert it to a temperature
Linting says too many statements - combine lat/long in a fairly reasonable manner
Backwards compatibility unit test
Better doc
* Allow multiple proximities
* Distance conversion
* Add unit of measurement and conversion to proximity
* Shorten attribute name
* Fix get unit of measurement
* Fix the km <-> m conversion
* Add type check and errors
* first path unit test around distance utility
* Fix numeric type check
* Fix conversion type-os
* Actually set the exception thrown flag
* Test for exact conversion
* More descriptive variable names
* Update method invocation to match change in method name
* Missed a couple variables
* Line continuation
* Fix linting too many return issue
* Break out proximity setup for list of proximity and for single proximity device
* Pass hass to setup function
* Check if setup succeeded for each proximity component
* Change variable name
* Break out branches in convert to avoid too many branches linting error
* Remove disable lint line
* Variables for default properties
* Combine logic
* Test loading multiple proximities for 100% code coverage on proximity component
* Unit test to reach 100%
Fail to configure proximities missing devices
* Fail first before processing
* Combine return statements
* lstrip = bad Teagan
* Utilize string formating instead of concatenation
* Fix variable reference
* Typeo
* Clean up conversion to reduce complexity
* Update unit tests to match code changes on distance util
* Test non numeric value
* Private methods, value type has already been checked.
* Fix deprecated(moved) import
* Add util/dt typing
* Green on mypy util/dt
* Fix some errors
* First part of yping util/yaml
* Add more typing to util/yaml
Default behavior for warm/cold white channels is to assume the white
channel is mixed with the rgb. This is a sane default and should support
the Fibaro RGBW LED controller.
* Stick version numbers
* Move elevation to core config
* Migrate forecast test to requests-mock
* Migrate YR tests to requests-mock
* Add requests_mock to requirements_test.txt
* Move conf code from bootstrap to config
* More config fixes
* Fix some more issues
* Add test for set config and failing auto detect
* Removed webcolors dependency in favor of dictionary lookup.
* Fixed code style errors.
* Moved color dictionary to module per suggestion.
* Removed try/except per suggestion.
* Add support for providing color_name which accepts a CSS3 valid, human readable string such as red or blue
* Forgot the schema validation!
* ugh farcy
* use html5_parse_legacy_color for more input options
* Add webcolors==1.5 to setup.py
* Block pylint no-member errors on tuple
* add color_name_to_rgb test
* whoops
* revert changes to individual platforms
* If color_name is set, pop it off params and set rgb_color with it
* Forgot to reset wink.py
* Import the legacy function as color_name_to_rgb directly
* reset test_color.py
* Improve light services.yaml
"unix" timestamp is number of seconds since Jan 1, 1970 UTC.
This allows scripts that use templates to generate time
deltas in seconds if desired from state attributes such
as last_updated.
Some examples:
timestamp now is
{{ as_timestamp(now) }}
timstamp of last change is
{{ as_timestamp(states.binary_sensor.garage_door.last_changed) }}
seconds since last change is
{{ as_timestamp(now) - as_timestamp(states.binary_sensor.garage_door.last_changed) }}
Instead of nested tracebacks, show a simpler error message.
Config directory: /home/user/.homeassistant
ERROR:homeassistant.util.yaml:duplicate key: "script"
in "/home/user/.homeassistant/configuration.yaml", line 95, column 0
in "/home/user/.homeassistant/configuration.yaml", line 108, column 0
* Make a flatter one level inheritance, with MySensorsLight as parent
with four children, one per light type.
* Break out helper methods. One per plain light, dimmer and RGB/RGBW
children and per update, turn_on and turn_off, nine in total. Put
these in the parent.
* Call the helper methods as needed from the child methods update,
turn_on and turn_off.
* Change name of MySensorsLightLight to MySensorsLightPlain.
* Fix module docstrings according to pep257.
* Change name of color util method from rgb_hex_to_list to
rgb_hex_to_rgb_list.
* Add unit tests for rgb_hex_to_rgb_list.
* Add a light entity class per V_LIGHT, V_DIMMER, V_RGB and V_RGBW.
Make these classes inherit each other up to MySensorsLight class.
* Map the entity classes to their S_TYPE in a dict.
* Check if an entity class map or just an entity class have been passed
to pf_callback_factory before using the entity_class variable in
homeassistant/components/mysensors.py.
* Add rgb_hex_to_list function in homeassistant/util/color.py.
This commit is to fix issue #325.
There were three issues with the PIP installations.
1) If multiple instances of the same platform were found, pip could
attempt to install the same dependency multiple times at once by being
run simultaneously in different processes. This would cause pip
failures due to race conditions. This has been fixed by using a thread
lock to allow only one instance of PIP to run at a time.
2) PIP would not check the target if the dependency was already met.
This would lead to PIP attempting to reinstall every dependency on
every boot. This would eventually fail because the package was already
installed, but it significantly increased boot time, especially on
Raspberry Pis.
3) PIP would not upgrade packages that were already installed. Usually,
when a version is specified to PIP, it will install the specified
version if it is not already installed, even without the \-\-upgrade
flag. This behavior did not work when using the \-\-target flag. When
using the target flag, a new install is always attempted, but nothing
will be overwritten unless the \-\-upgrade flag is also given. This
caused new packages to not be installed when their dependencies were
increased. This is fixed by defaulting towards using the
\-\-upgrade flag.
Cleaned up default config directory determination.
Made bootstrap creators for HA always set config directory.
Made bootstrap creators set the local library in the Python Path.
Moved all exceptions to their own file to make imports easier.
Moved default configuration directory be in the users’ profile.
Moved pip installs to be done to a lib folder in the config directory.
Reduced requirements.txt to only the barebones reqs.