Fabian Affolter
57c2dea02d
Add timestamp filters ( #2596 )
2016-07-22 19:47:43 -07:00
Teagan Glenn
ae5dfbdf55
Allow templates for delays in scripts ( #2560 )
2016-07-20 20:26:17 +02:00
Philip Lundrigan
d13cc227cc
Push State ( #2365 )
...
* Add ability to push state changes
* Add tests for push state changes
* Fix style issues
* Use better name to force an update
2016-06-26 00:33:23 -07:00
Paulus Schoutsen
68df3deee0
ABC consistent not implemented behavior ( #2359 )
2016-06-24 21:27:40 -07:00
Paulus Schoutsen
a70f922a71
ps - add reload core config service ( #2350 )
2016-06-22 09:13:18 -07:00
Paulus Schoutsen
6dcf3682df
Tweak event helper
2016-06-12 20:37:37 -07:00
Martin Hjelmare
81ca175906
Add mysensors IR switch device and service ( #2239 )
...
* Add mysensors IR switch device and service
* Add MySensorsIRSwitch as child class to MySensorsSwitch.
* Add platform specific service mysensors_send_ir_code. Only call
device method in service function if device is IR device.
* Add service and required attribute to state helper to support scenes.
* Move V_IR_SEND type from sensor.mysensors to switch.mysensors
platform.
* Populate switch.services.yaml with service descriptions.
* Fix check of entity_id in service function
Since multiple entity_ids can be passed as service data, and the
entity_id service attribute is forced to a list by the service
validation schema, the check in the service function should iterate
over any entity ids.
2016-06-12 23:04:45 +02:00
Paulus Schoutsen
30f74bb3ca
Migrate to generic discovery method ( #2271 )
...
* Migrate to generic discovery method
* Add tests for discovery
2016-06-11 17:43:13 -07:00
Paulus Schoutsen
c9756c40e2
Bugfixes random ( #2270 )
...
* Fix Z-Wave autoheal network
* Make config_per_platform handle bad config better
2016-06-10 22:53:31 -07:00
Thiago Oliveira
02f342b670
add fan_min_on_time service to ecobee ( #2159 )
2016-06-09 23:34:29 -07:00
Daniel Høyer Iversen
e44c2a4016
Improve config validation for group ( #2206 )
...
* Improve config validation if invalid entity for groups
* Improve error message when entity id is invalid
2016-06-08 20:55:08 -07:00
Paulus Schoutsen
3ac31b2c1b
Fix broken tests + linting
2016-05-30 10:19:12 -07:00
Jan Harkes
afe84c2a8b
Allow time condition windows to cross midnight. ( #2158 )
...
* Allow time condition windows to cross midnight.
* Address comments.
Fold _in_time_window back into the time() condition test.
Use specific time values to test the time window.
2016-05-29 14:32:32 -07:00
Paulus Schoutsen
15e329a588
Tons of fixes - WIP
2016-05-21 15:01:33 -07:00
Robbie Trencheny
d553c7c8e7
Merge pull request #2027 from robbiet480/relative-time-filter
...
Add a Jinja filter for relative time
2016-05-11 22:50:56 -07:00
Robbie Trencheny
4d0b9f1e94
Stupid blank lines
2016-05-11 22:44:44 -07:00
Robbie Trencheny
fca4ec2b3e
simplify the relative_time function
2016-05-11 22:37:37 -07:00
Johann Kellerman
fbe940139a
Discovery listener on all EntityComponents ( #2042 )
2016-05-11 21:58:22 -07:00
Paulus Schoutsen
3c9e493494
Make AND and OR conditions valid ( #2037 )
2016-05-10 21:49:58 -07:00
Robbie Trencheny
16933abce9
Remove humanize and use a relative time thing that @balloob found on Github
2016-05-10 00:04:53 -07:00
Robbie Trencheny
d5a1c52359
Add a Jinja filter for relative time
2016-05-09 23:31:02 -07:00
Johann Kellerman
ec9544b9c3
Add a load_platform mechanism ( #2012 )
...
* discovery.load_platform method
* rm grep
2016-05-09 22:48:03 -07:00
Paulus Schoutsen
6856283896
Make HVAC naming consistent ( #2017 )
2016-05-09 07:53:01 -07:00
Paulus Schoutsen
e40908d67c
Improve config validation error message
2016-05-07 22:31:22 -07:00
Daniel Høyer Iversen
21dd8162b3
Improve error message for invalid key in config ( #1975 )
...
* Improve error message for invalid key in config
* Refactor log exception in config validation
2016-05-07 07:35:42 -07:00
Charles Spirakis
b86a1ece01
Allow conversion from date strings to "unix" timestamp. ( #1985 )
...
"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) }}
2016-05-06 18:33:46 -07:00
John Arild Berentsen
1a59ba735f
Initial HVAC component + Z-Wave platform ( #1912 )
2016-05-03 18:27:51 -07:00
Paulus Schoutsen
2a972b7fe3
Fix script condition issue (Thanks @bart274) ( #1972 )
2016-05-03 18:19:55 -07:00
Paulus Schoutsen
79653a672d
Script cleanup ( #1963 )
2016-05-02 22:05:09 -07:00
Paulus Schoutsen
1d28fa712f
Fix script merge conflict
2016-04-28 13:39:44 +02:00
gwendalg
31e019e88a
script: Fix log output ( #1918 )
...
Signed-off-by: Gwendal Grignou <gwendal@gmail.com>
2016-04-28 13:19:38 +02:00
Paulus Schoutsen
6354399d55
Initial script condition support ( #1910 )
2016-04-28 12:03:57 +02:00
Paulus Schoutsen
197d9639f9
Merge pull request #1882 from home-assistant/service-parameters
...
Trigger variables in automation actions
2016-04-23 07:46:26 +02:00
Paulus Schoutsen
14bd630c1d
Service/Script cleanup
2016-04-23 07:11:21 +02:00
Paulus Schoutsen
1d8554359c
Allow setting entity namespace ( #1887 )
2016-04-23 06:34:49 +02:00
Paulus Schoutsen
4a5411a957
Allow calling scripts from Alexa
2016-04-22 05:30:30 -04:00
Paulus Schoutsen
26863284b6
Script helper: support variables
2016-04-21 21:42:20 -04:00
Paulus Schoutsen
f76d545a08
Add script logic into helper.
2016-04-21 21:06:05 -04:00
Paulus Schoutsen
4e568f8b99
Automation: Add trigger context and expose to action
2016-04-21 13:59:42 -07:00
Paulus Schoutsen
4acb121689
Allow variables in service.call_from_config
2016-04-21 12:22:19 -07:00
Paulus Schoutsen
2e79e9d5bb
Correct celcius to celsius ( #1860 )
2016-04-19 20:30:44 -07:00
Paulus Schoutsen
c89e9d87e8
Catch platform setup error ( #1847 )
2016-04-17 22:07:53 -07:00
Paulus Schoutsen
68d92c3196
Use standardised datetime format
2016-04-16 01:46:50 -07:00
Paulus Schoutsen
4f834ba3f1
Make all entity_ids lowercase ( #1786 )
2016-04-10 15:20:20 -07:00
Fabian Affolter
f6331da000
Remove print
2016-04-08 08:03:14 -07:00
Jan Harkes
29c30861bf
Be flexible in what we accept for script.delay configuration. ( #1738 )
...
Accept delay configuration even when someone forgets to indent the time
specification.
Also removed 'weeks' and 'microseconds' from acceptable delay values.
There is a new homeassistant release every 2 weeks and running scripts
are not persisting across restarts. And there is still the option of
using (weeks*7) days if the long delay is really necessary.
And if someone really depends on microsecond delay precision we are
unlikely to be able to provide this accuracy, even milliseconds is
suspect for that matter but will at least allow us to specify some
subsecond delay.
2016-04-07 12:19:28 -07:00
Jan Harkes
5b17f629ad
Test function for mqtt topic validators and IsFile() linting fix ( #1740 )
...
* Add test function for mqtt topic validators.
* Fix for linting error on vol.IsFile()
2016-04-07 13:52:25 -04:00
Paulus Schoutsen
8ef542927f
Add automation config validation
...
* Add automation config validation
* Remove unnecessary dict validator
* Downgrade voluptuous to 0.8.9
* Fix linting
* Address issues
2016-04-04 12:18:58 -07:00
Jan Harkes
cbe9a7d2a3
Add case insensitive testing to boolean string validation.
2016-04-03 21:38:58 -07:00
Paulus Schoutsen
e140e9b8ab
Add script + extra config validators
...
* Add config validation and extra validators
* Address PR comments
2016-04-03 10:19:09 -07:00
Paulus Schoutsen
f6d584af09
Allow platforms to specify PLATFORM_SCHEMA
2016-04-02 20:10:57 -07:00
Jan Harkes
afd1e6a5cc
Service validation for media_player component
2016-04-02 03:51:03 -04:00
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