Commit Graph

2748 Commits (9b341f5b67737c4cccd1bfedbc7d56aa31530969)

Author SHA1 Message Date
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