Commit Graph

928 Commits (993088d26e93f7d753e8477eb4a77391bc36e1a2)

Author SHA1 Message Date
Jan Harkes 6d914126fa Validate data read from light_profiles.csv 2016-03-31 23:29:07 -04:00
Jan Harkes 017f47dd2c Service validation for light.turn_on/.turn_off/.toggle 2016-03-31 22:03:38 -04:00
Paulus Schoutsen 5b00919bed Merge branch 'pr/1643' into dev
Conflicts:
	requirements_all.txt
2016-03-29 23:23:45 -07:00
Daniel J. Kemp 86199c8277 Add onkyo receiver, and source select support
Added onkyo receiver component

Added support for input source selection to media players,
and do the onkyo receiver component.
2016-03-29 22:17:36 -04:00
Paulus Schoutsen 25269cdb6b Add tests for bootstrap config validation 2016-03-29 00:17:53 -07:00
Paulus Schoutsen 5baa98b79f Add initial config validation 2016-03-28 23:46:12 -07:00
Fabian Affolter 9157bd38e8 Update docstrings 2016-03-25 20:35:38 +01:00
Paulus Schoutsen ddc139b853 Merge pull request #1510 from persandstrom/automation_templating
Use templates in service calls
2016-03-11 21:49:47 -08:00
Per Sandström 81e5a852f0 Use templates in service calls 2016-03-10 21:36:05 +01:00
Paulus Schoutsen 47c4f66886 Merge pull request #1485 from MartinHjelmare/refactor-scene-reproduce_state
Refactor reproduce_state for scene component
2016-03-09 15:29:10 -08:00
Fabian Affolter 0d9b8a0d06 Fix docstring 2016-03-09 23:49:54 +01:00
MartinHjelmare c56701baaf Refactor reproduce_state for scene component
* Add tests to reach full coverage for helpers/state.py.
* Refactor reproduce_state function in helpers/state.py. Add two dicts,
	as global constants, service_attributes and service_to_state. Use
	these in combination with the dict of services per domain from
	ServiceRegistry, to find the correct service to use in a scene state
	change.
* Use break statement in for loop, to break if service was selected
	to update state, in preference to update state attributes, ie state
	update takes precedence.
* Add ATTR_CODE and ATTR_CODE_FORMAT in const. Import these in
	alarm_control_panel and lock platforms instead of making duplicate
	constants in multiple modules.
* Use ATTR_MEDIA_CONTENT_TYPE and ATTR_MEDIA_CONTENT_ID in media_player
	platform in SERVICE_PLAY_MEDIA and play_media methods, instead of
	'media_type' and 'media_id'.
* Fix PEP257 in modified files.
2016-03-09 18:52:05 +01:00
Fabian Affolter f22a40c3e8 Fix PEP257 issues 2016-03-09 11:15:04 +01:00
Fabian Affolter 4f536ac63d Fix PEP257 issues 2016-03-07 23:39:52 +01:00
Paulus Schoutsen 35aa9aa863 Merge pull request #1383 from kk7ds/virtual-binary-sensor
Template binary sensor
2016-02-24 22:15:01 -08:00
Dan Smith db4bf7319f Add float() operator to templates 2016-02-24 20:07:46 -08:00
Paulus Schoutsen 967a751da1 Add entity_picture property 2016-02-23 22:41:24 -08:00
Fabian Affolter 582394bc3b Modify import of template and PEP257 2016-02-23 21:19:22 +01:00
Fabian Affolter 213cc920d0 Move template to helpers 2016-02-23 21:19:10 +01:00
Paulus Schoutsen c3bb6d32aa Add closest template helper 2016-02-21 11:13:40 -08:00
Paulus Schoutsen e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
Paulus Schoutsen de7a14074e Merge pull request #1247 from balloob/feature/entity-assumed-state
Add assumed_state property to entity
2016-02-14 23:59:35 -08:00
Paulus Schoutsen dabb8d5bbc Merge pull request #1246 from balloob/feature/remove-state-fire-event
Have remove state fire state_changed event
2016-02-14 10:33:59 -08:00
Paulus Schoutsen b29f2f6d6f Remove usage of ATTR_FRIENDLY_NAME within components/platforms 2016-02-14 00:21:20 -08:00
Paulus Schoutsen 8bea5c06de Add assumed_state property to entity 2016-02-13 23:42:11 -08:00
Paulus Schoutsen ada2fb4ec0 Fire event when we remove a state 2016-02-13 22:57:40 -08:00
Paulus Schoutsen e170484f16 Change helpers.extract_domain_configs from generator to list bc concurrency 2016-02-13 21:20:49 -08:00
Paulus Schoutsen 1571b33e4a Fix: state_as_number always return float 2016-02-13 00:08:32 -08:00
Paulus Schoutsen 06bd812b7b Make state unknown if None returned 2016-02-12 08:58:07 -08:00
Dan Smith 3aa34deaa2 Add state_as_number() helper
This adds state_as_number(), a helper method that tries to interpret
state as a number, for cases we can predict. It's a generalization of
what is copy-and-paste-ed into multiple other places.
2016-02-12 00:41:32 +00:00
Paulus Schoutsen b0948bef5f Make State class immutable 2016-02-09 23:27:01 -08:00
Paulus Schoutsen f08b77dc4c Clean up state_attributes vs device_state_attributes 2016-02-06 22:34:24 -08:00
MartinHjelmare 38c9f7a37a Fix 'unavailable' entity
* Report friendly_name, icon and customized attributes for 'unavailable'
  entities.
2016-02-01 02:16:56 +01:00
MartinHjelmare 455593017d Add new 'available' property to entity.py
* Add 'available' property. Return True by default.
* Use new property in update_ha_state(). If available is False, set
  state to 'unavailable', through constant.
* Add STATE_UNAVAILABLE constant 'unavailable' in const.py.
* Fix docstrings in entity.py and const.py, according to PEP257.
  Ignore D203 and D105.
2016-01-31 23:58:19 +01:00
Paulus Schoutsen fce8815ab4 Support custom interval for platforms 2016-01-31 01:01:23 -08:00
Paulus Schoutsen 90e17fc77f Add tests for entity component 2016-01-31 01:01:23 -08:00
magnusknutas ca070a36e3 Dont wrap '/int' parameters with tuple 2016-01-26 21:38:07 +01:00
magnusknutas 33b0f4d05d Fixes bug in time trigger and adds test for ex. /two 2016-01-26 20:43:29 +01:00
magnusknutas ebd475b380 Unused import was the problem 2016-01-26 18:50:25 +01:00
magnusknutas 726637b867 New and improved handling of the matching! Kudos to @balloob 2016-01-26 18:37:19 +01:00
magnusknutas ec5d88b98e hourly periodic task 2016-01-26 17:06:50 +01:00
magnusknutas 13fbefcdf8 Running periodic tasks 2016-01-26 10:28:31 +01:00
Ryan Kraus 8406f81811 Removed decorator callback
The decorator callback was not actually necessary so it was removed and
replaced with a partial function instead.
2016-01-25 00:14:16 -05:00
Ryan Kraus bcdfc555e0 Removed service decorator from event decorators 2016-01-24 23:09:09 -05:00
Ryan Kraus 3b89102338 Fixed lint issue from merge
extract_entity_ids from the service helpers was overwriting the service
decorator with one of its attributes. This was fixed.
2016-01-24 23:00:43 -05:00
Ryan Kraus 60dd2d441d Merge remote-tracking branch 'balloob/dev' into automation-decorator
# Conflicts:
#	homeassistant/helpers/service.py
#	tests/helpers/test_service.py
2016-01-24 22:51:00 -05:00
Ryan Kraus 5830da63b1 Moved service decorator to service helpers
Moved the service decorator to the service helpers module and moved the
associated tests.
2016-01-24 22:46:30 -05:00
Ryan Kraus 54b82ecd91 Lint fixes and additions to event decorators
1. service decorator was overwriting the function name with one of its
arguments.
2. Accidentally left an extra argument in track_sunrise.
3. Added track_utc_time_change decorator.
2016-01-24 21:06:15 -05:00
Ryan Kraus 57725136c0 Many updates regarding event decorators
1. Added HASS to the arguments for callbacks that are created with
event decorators.
2. Added a service decorator.
3. Updated example.py in the example config to use the event decorators.
2016-01-24 19:52:22 -05:00
Ryan Kraus 40dbeb0b60 Another revision on event decorators
This revision of event decorators removes much of the complexity. The
decorated functions are no longer wrapped with a class that tracks
last_run, etc. Bootstrap now gives hass to the event_decorators module
before initializing components so the decorators no longer require
activation.
2016-01-24 17:46:05 -05:00
Ryan Kraus ef92940ffb A few lint fixes to event decorators. 2016-01-24 16:45:35 -05:00
Ryan Kraus 02e634c6a2 Fixed bugs to allow HA to boot again
1) helpers/event should not import the sun component unless it is
requested. This prevents circular import.
2) fixed import typo in bootstrap
2) bootstrap cannot import event_decorators until it is needed because
this leads to a circular import.
2016-01-24 15:55:47 -05:00
Ryan Kraus 0f937cad74 Initial pass at event decorators
Created event decorators for custom components. Decorators were created
for the events: track_state_change, track_sunrise, track_sunset, and
track_time_change.
2016-01-24 15:28:09 -05:00
Ryan Kraus 81dd1515ae Moved sunrise/sunset tracking to helpers
The automation component contained some very handy and generic
functions for tracking sunset and sunrise. This was moved to
helpers/event.py.
2016-01-24 15:07:09 -05:00
Paulus Schoutsen 53484e46a3 Move generate_entity_id to entity helpers 2016-01-23 23:00:46 -08:00
Paulus Schoutsen de79a46d43 Move extract_entity_id to service helpers 2016-01-23 22:57:14 -08:00
Paulus Schoutsen bc19ef66bf Move split_entity_id to helpers 2016-01-23 22:49:49 -08:00
Paulus Schoutsen de08f0afaa Load YAML config into an ordered dict 2016-01-23 22:41:01 -08:00
Ryan Kraus 027d97321f Merge pull request #911 from rmkraus/service-toggle
Added toggle service
2016-01-17 21:11:35 -05:00
Paulus Schoutsen a9c6f8c1d9 Enforce entity attribute types 2016-01-17 17:50:20 -08:00
Ryan Kraus 85aa4fdd2e Revised entity toggle to use is_on
The toggle function in the Entity ABC was using state == STATE_ON to
determine whether the entity was on. This was revised to use the is_on
property instead.
2016-01-17 16:59:22 -05:00
Ryan Kraus 342a819fd4 Added toggle service
Added a toggle service to the homeassistant, light, switch, and
media_player domains.
2016-01-16 10:45:05 -05:00
Paulus Schoutsen 73cdf00512 More service helper tests 2016-01-09 16:01:27 -08:00
Paulus Schoutsen 12b5caed70 ps - strip entity IDs in service call 2016-01-09 15:51:51 -08:00
Paulus Schoutsen 825c91f0c3 Add calling service functionality to Alexa 2016-01-08 18:54:28 -08:00
Paulus Schoutsen 8983a97c70 Fix calling turn_on for groups with mixed content 2016-01-03 21:25:15 -08:00
Paulus Schoutsen 736183e6f5 Fix bug in reproduce_state with complex state attributes 2016-01-03 11:27:30 -08:00
Paulus Schoutsen f8b2570cb3 Group entities when reproducing a state 2016-01-03 02:32:09 -08:00
Paulus Schoutsen 561a78bef3 Fix EntityComponent deadlock 2015-12-22 02:19:55 -08:00
Paulus Schoutsen a301d869d7 PyLint 1.5 fixes 2015-11-29 13:49:05 -08:00
Paulus Schoutsen 99aa4307ef Add locks to entity component 2015-11-28 15:55:01 -08:00
Paulus Schoutsen 4d069323f4 Add icon support to entity 2015-11-03 00:20:48 -08:00
Paulus Schoutsen 12495c717e Fix script regression 2015-10-28 12:24:33 -07:00
Paulus Schoutsen 3d972abdab Clean up the heat control thermostat 2015-10-22 22:04:37 -07:00
Jon Maddox 45f0911640 move play_media to the top so it catches first 2015-10-08 20:37:59 -04:00
Jon Maddox 26939ce554 style 2015-10-07 01:37:40 -04:00
Jon Maddox dbcc3a76ea style 2015-10-07 01:29:55 -04:00
Jon Maddox 6c4b2fd638 derp 2015-10-07 01:01:25 -04:00
Jon Maddox 6afb846d04 avoid key errors 2015-10-07 00:56:14 -04:00
Jon Maddox ad549be353 support play_media for state restoration (for scenes) 2015-10-07 00:39:38 -04:00
Paulus Schoutsen 68c2b539ee More flexible domain config extraction 2015-09-28 23:09:05 -07:00
Paulus Schoutsen 3625646c34 Fix reproduce_state 2015-09-23 23:35:08 -07:00
Jon Maddox efdd0c9e8a don't break the chain 2015-09-24 01:35:08 -04:00
Jon Maddox 8d42e42230 style 2015-09-24 00:38:18 -04:00
Jon Maddox 90f35b35cd moar derp 2015-09-24 00:20:17 -04:00
Jon Maddox 082920abe0 moar constants 2015-09-24 00:20:05 -04:00
Jon Maddox 4a8bbc52e0 derp 2015-09-24 00:15:36 -04:00
Jon Maddox 1674c8309a Support playing, pausing states for media players when reproducing state
This allows the state helper to call the correct service call for
media_players when attempting to resolve state.
2015-09-24 00:06:05 -04:00
Paulus Schoutsen 5af1643297 Add warning when entity not found in reproduce_state 2015-09-15 22:23:07 -07:00
Paulus Schoutsen f9b17ab026 Device tracker rewrite 2015-09-09 23:37:15 -07:00
Ryan Kraus f5b98c86f0 Mostly PyLint and Flake8 updates.
Rewrote imports of exceptions to be from the exceptions module.
Made nmap scanner check for libnmap dependency without crashing.
Various flake8 and pylint updates.
2015-08-29 22:34:35 -04:00
Paulus Schoutsen 086961d109 Add temperature util, helpers 2015-08-16 22:06:01 -07:00
Paulus Schoutsen 1b89a502c4 Extract core into own submodule 2015-08-16 20:44:46 -07:00
Paulus Schoutsen d2b5f429fe Remove deprecated code 2015-08-04 16:21:09 -04:00
Paulus Schoutsen 14023a15e6 Minor code cleanup 2015-08-04 18:13:55 +02:00
Paulus Schoutsen 382c1de981 Built-in components no longer use deprecated methods 2015-08-03 17:08:13 +02:00
Paulus Schoutsen 7870e9a5e2 Minor cleanup core 2015-08-03 17:05:33 +02:00
Paulus Schoutsen e0468f8b8e Extract helpers.event from core + misc cleanup 2015-07-26 10:45:49 +02:00
Paulus Schoutsen 66a380dd8e Ensure generate_entity_id returns valid entity ids 2015-06-01 22:55:33 -07:00
Paulus Schoutsen a4e0a7f235 Fix platform discovery not working 2015-05-14 21:36:12 -07:00
Paulus Schoutsen 4eeaa16f16 Convert some double to single quotes. 2015-05-11 22:23:38 -07:00
Paulus Schoutsen e630476f9f Allow platforms to specify dependencies 2015-05-11 22:23:20 -07:00
Paulus Schoutsen e0ecb64a10 Use UTC as the internal datetime format 2015-04-28 19:12:05 -07:00
Ryan Kraus 45f2f07b6d Used better method for overwritting attributes in entity. 2015-04-25 18:29:37 -04:00
Ryan Kraus be3be0478b Fixed bug in entity helper that ignored suggestions for hiding states. 2015-04-25 14:59:27 -04:00
Ryan Kraus 8255164eda Rearranged visibility control and image control in the configuration file. Now a single generic clause can be used to customize any attribute. 2015-04-25 14:47:15 -04:00
Ryan Kraus a95aad324f Updated a comment in the entity class. 2015-04-25 01:29:42 -04:00
Ryan Kraus f77b3dbd0a Added decorate option to configuration file to allow a user to set custom images for different entities. 2015-04-25 00:39:35 -04:00
Paulus Schoutsen b855f422ef Tweak visibility config 2015-04-23 06:41:41 -07:00
Ryan Kraus bd3b93f290 1) Added visibility documentation to the CONTRIBUTING.md documentation. 2) Pylint fixes to homeassistant/helpers/entity.py 2015-04-22 22:19:36 -04:00
Ryan Kraus ff3dacedc0 Moved card visibility logic out of the Entity class and into a VisibilityABC. Then made the Group class inherit the VisibilityABC. No duplication of code now. This is definitely better. 2015-04-22 21:21:50 -04:00
Ryan Kraus b20424261c 1) Performed many pylint and flake8 fixes to clean up isy994 integration and hidden entities addition. 2) Added necessary code to allow groups to also be hidden. 3) Made most of the weather data from the isy994 component be hidden by default. 2015-04-15 02:05:34 -04:00
Ryan Kraus 0334074a52 Quick fix to the comparison to validate if an entity is hidden. 2015-04-14 23:38:14 -04:00
Ryan Kraus a3d6972268 1) Added basic back-end framework for supporting hidden entities. 2) Enabled hidden suggestions in the isy994 component entities. 2015-04-14 22:57:32 -04:00
Paulus Schoutsen 49d7901585 Tweaks to EntityComponent.setup_platform 2015-03-21 22:21:57 -07:00
Paulus Schoutsen cdd5d1196a Fix regression from refactoring EntityComponent 2015-03-21 22:14:30 -07:00
Paulus Schoutsen a9324ba9d4 Update components to use Entity instead of Device 2015-03-21 19:16:13 -07:00
Paulus Schoutsen d3f0210b1a Refactor helper.device to helper.entity
Introduces a minor backwards compatible change: device_component
function add_devices is renamed to add_entities.
2015-03-21 18:49:30 -07:00
Paulus Schoutsen 9b643d57f0 ps: Add a global config object to Home Assistant 2015-03-18 23:02:58 -07:00
Paulus Schoutsen 1245af356b Scene bugfixes and UI improvements 2015-03-16 23:32:18 -07:00
Paulus Schoutsen 19a43cea26 Add scene component 2015-03-15 23:36:42 -07:00
andythigpen 06ad3987ba Add support for lists when using config_per_platform helper.
With the recent change to YAML, it is now easier to support lists by
default.  Any config section that previous relied on the "domain",
"domain 1", "domain 2" format can now use YAML lists instead.  The old
format is also still supported.
2015-03-10 18:30:36 -05:00
Paulus Schoutsen fde0ce1997 Remove CONF_TYPE and platform_devices_from_config 2015-03-06 00:04:32 -08:00
Paulus Schoutsen 3e15742875 Move device ABCs to separate helper file 2015-03-05 23:18:22 -08:00
Paulus Schoutsen 84844c242b Refactor chromecast into media_player platform 2015-03-03 23:50:54 -08:00
Paulus Schoutsen 00047009e2 Only poll for device updates if necessary 2015-03-01 11:04:07 -08:00
Paulus Schoutsen 5fe50066a6 Make device component backwards compatible 2015-03-01 10:28:53 -08:00
Paulus Schoutsen 89100d14c8 Refactored device components 2015-03-01 01:35:58 -08:00