Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.50 #8685

Merged
merged 120 commits into from
Jul 29, 2017
Merged

0.50 #8685

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
5581c62
Fix iFrame panel test
balloob Jul 13, 2017
ba019c7
Make deps directory persistent over upgrades (#7801)
MartinHjelmare Jul 14, 2017
4fde0ff
LIFX: support for multizone (#8399)
amelchio Jul 14, 2017
d8abef9
Add RGB support to switch.flux (#8417)
d0ugal Jul 14, 2017
9373d5e
Fix media_position for cast component (#8452)
dersger Jul 14, 2017
d473f34
Remove km from visibility, add visibility_distance (#8454)
gollo Jul 14, 2017
5829cdf
Radarr sensor fix for issue #8250 (#8456)
hoopty Jul 14, 2017
87b83f3
Accept transition for light.toggle (#8466)
amelchio Jul 14, 2017
6ca828f
Make themes API work even when themes are not defined. (#8473)
andrey-git Jul 14, 2017
543e8bb
Fix check for running inside venv (#8481)
MartinHjelmare Jul 15, 2017
23b65bf
Version bump to 0.50.0dev0
balloob Jul 16, 2017
bffa0d2
Bump to KNXIP 0.5 (#8492)
Jul 16, 2017
d3be056
Expose all components on hass [Concept] (#8490)
balloob Jul 16, 2017
d29bddd
Add bind_hass to components (#8502)
balloob Jul 16, 2017
f6c3832
Fix TP-Link device tracker regression since 0.49 (#8497)
maikelwever Jul 16, 2017
d0275c8
Persistent notification import (#8507)
balloob Jul 16, 2017
ffd3081
Added additional attributes to OwnTracks device_tracker (#8503)
Jul 16, 2017
8c95574
Update dlib_face_detect.py (#8516)
pvizeli Jul 17, 2017
40aafcd
prometheus: Convert fahrenheit to celsius (#8511)
rcloran Jul 17, 2017
f047985
Realfix for dlib (#8517)
pvizeli Jul 17, 2017
cca0d3e
Attach the `chat_id` for a callback query from a chat group (fixes #8…
azogue Jul 17, 2017
1a1571c
Added sensor state rounding (#8499)
fronzbot Jul 17, 2017
c67c20f
fix for a bug introduced with media support in #8282 (#8513)
MikeChristianson Jul 17, 2017
95e0027
Fix KeyError
fabaff Jul 17, 2017
8c9b389
handle timeout errors without logging.exception when updating hue lig…
azogue Jul 17, 2017
b83ff73
Remove deprecated automation keywords (#8510)
amelchio Jul 17, 2017
fde4a7d
Citybikes: Allow None as result for empty slots (#8528)
janLo Jul 17, 2017
dcd6f7a
Return a 0 temperature value when none is found (#8518)
phil-lavin Jul 17, 2017
4ae11c0
Fix #6469 and #6828 (#8537)
titilambert Jul 18, 2017
879c816
Update docstrings (#8536)
fabaff Jul 18, 2017
2aa89cf
Upgrade TwitterAPI to 2.4.6 (#8535)
fabaff Jul 18, 2017
2926621
Fix support for multiple Apple TVs (#8539)
postlund Jul 18, 2017
5e1ff20
Decora: Fix set brightness and improve reconnection (#8522)
titilambert Jul 18, 2017
d54a634
Update demo.py
balloob Jul 18, 2017
1a86fa5
Initial support for Google Wifi/OnHub (#8485)
fronzbot Jul 18, 2017
4ece4bf
Fix exception dlib_face_identify when image is not recognized by face…
tchellomello Jul 19, 2017
6bc0729
[media_extractor] Add support for custom stream queries for media_ext…
minchik Jul 19, 2017
42699b7
Report Harmony remote off if state is unknown (#8547)
jawilson Jul 19, 2017
c8bfcd2
Upgrade the alarmdecoder dependency library from 0.12.1 to 0.12.3. (#…
viswa-swami Jul 19, 2017
c27074e
turn_on_action and turn_off_action with script syntax (#8558)
azogue Jul 19, 2017
f1280d3
Extends Pi-hole sensor to support the new sensors: (#8549)
tchellomello Jul 19, 2017
84ebcd8
Support for Wink Switch and Light groups also fix fan speed selection…
Jul 19, 2017
54755df
Added a service to write to KNX group addressed including documentati…
Jul 20, 2017
9cc3e7e
Handle manual edits to emulated_hue_ids.json (#8560)
jawilson Jul 20, 2017
8a42e15
LIFX: assume default features for unknown products (#8553)
amelchio Jul 20, 2017
ee05a4a
Fix broken status update for lighting4 devices (#8543)
ypollart Jul 20, 2017
8d1999d
Enhance python_script to support "_getitem_" (#8541)
sdague Jul 20, 2017
49c399c
Update persistent deps dir version in config.py (#8479)
balloob Jul 20, 2017
fde291f
Add is_lighting4 to RfxtrxBinarySensor (#8563)
Danielhiversen Jul 20, 2017
bc27d17
Bump pyver to fix exception in fetching colours.
pavoni Jul 20, 2017
966809c
Merge pull request #8564 from home-assistant/bump_pyvera
pavoni Jul 20, 2017
90639d3
Xiaomi gw support (#8555)
Danielhiversen Jul 20, 2017
7189494
fix #8263 corrected Adafruit DHT library version from 1.3.0 to 1.3.2 …
namadori Jul 20, 2017
a5c0831
xiaomi bug fix (#8576)
Danielhiversen Jul 20, 2017
e63a96c
Bumped python-simplisafe version (#8578)
bachya Jul 20, 2017
4f8d2ec
Added Time Remaining and Time Elapsed sensors for octoprint (#8581)
Jul 21, 2017
f6a5e08
upgade xiaomi lib to 0.2 (#8584)
Danielhiversen Jul 21, 2017
fada6d3
Device support for different new sensors of the xiaomi aqara gateway …
syssi Jul 21, 2017
ee15306
Extends Fitbit sensors to track the device battery level (#8583)
tchellomello Jul 21, 2017
4359e0b
xiaomi binary sensor bug fix (#8586)
Danielhiversen Jul 21, 2017
06ceadf
upgrade pywebpush and PyJWT (#8588)
perosb Jul 21, 2017
dc42b63
Support for Wink oauth application authorization (#8208)
Jul 22, 2017
8d31c5f
zha: Update to bellows 0.3.4 (#8594)
rcloran Jul 22, 2017
7bea69c
update frontend
balloob Jul 22, 2017
7edf14e
Add Intent component (#8434)
balloob Jul 22, 2017
8e8ec7a
Remove code in wink.py overwriting hass.data configurator (#8595)
Jul 22, 2017
b4f392b
bump python-mirobo version for more robust protocol handling, make th…
rytilahti Jul 22, 2017
1807b45
Binary sensor ping fixed for hassio (#8573)
gollo Jul 22, 2017
2f08a91
Simplified percent conversion, better logging (#8568)
Jul 22, 2017
9043895
make attributes in the fritzdect module easier to process (#8436)
thomasklingbeil Jul 22, 2017
dac9716
Fix STATION_SCHEMA validation on longitude (#8610)
clkao Jul 23, 2017
c6bf529
Allow set_cover_position in scenes (#8613)
koenekelschot Jul 23, 2017
77d8e39
better but still not great (#8618)
cribbstechnologies Jul 23, 2017
cc2de5e
Upgrade youtube_dl to 2017.7.23 (#8617)
fabaff Jul 23, 2017
486bcc4
Upgrade mypy to 0.520 (#8616)
fabaff Jul 23, 2017
5d810da
REST binary sensor value_template optional (#8596)
philhawthorne Jul 23, 2017
3fec295
Bumped Amcrest version (#8624)
tchellomello Jul 24, 2017
1831a7d
Check if /dev/input/by-id exists (#8601)
schaal Jul 24, 2017
4b449f5
Tado Fix #8606 (#8621)
filcole Jul 24, 2017
f0293ee
prometheus: Fix zwave battery level (#8615)
rcloran Jul 24, 2017
b0b6026
ubus: Make multiple instances work again (#8571)
glance- Jul 24, 2017
f3d9086
Properly slugify switch.flux update service name (#8545)
jawilson Jul 24, 2017
a2abb4a
Update frontend
balloob Jul 24, 2017
654ad41
added onvif camera fix for non-virtual env installations (#8592)
matt2005 Jul 24, 2017
f86bd15
Cleanup old device_tracker stuff (#8627)
pvizeli Jul 24, 2017
1d31137
Update README.rst
balloob Jul 24, 2017
9d9ca64
Update README.rst
balloob Jul 24, 2017
98568b5
Add support for using credstash as a secret store (#8494)
justin8 Jul 24, 2017
ecc1429
Added support for default value when environment variable is missing …
Jul 24, 2017
cc03f7e
Manual alarm with MQTT control (#8257)
colinodell Jul 24, 2017
3b7f16f
Catch and log Lyft API errors (#8635)
emlove Jul 25, 2017
ad7370e
Update frontend
balloob Jul 25, 2017
c2828ba
Tweak conversation/intent/shopping list (#8636)
balloob Jul 25, 2017
cd2703e
Update dependencies cast + discovery (#8646)
balloob Jul 26, 2017
e83816c
Add component Light TPLink (#8643)
gollo Jul 26, 2017
7c12074
Fixes Fitbit sensor to report battery level with the expected device …
tchellomello Jul 26, 2017
81a27e7
Upgrade aiolifx (#8648)
amelchio Jul 26, 2017
fff269e
Velbus (#8076)
thomasdelaet Jul 26, 2017
abcfcdd
Yahoo Weather update, supports forecast for more days (#8626)
fanthos Jul 26, 2017
438edc5
History performance improvements for single-entity requests (#8632)
OverloadUT Jul 26, 2017
3318f02
Add transition support to light.zha (#8548)
jawilson Jul 26, 2017
3b4ea86
Add uk_transport component. (#8600)
robmarkcole Jul 26, 2017
f5eeb25
Added support for SerenaHoneycombShades to Lutron Caseta (#8662)
kfcook Jul 27, 2017
9d5c61b
MQTT Switch: add availability_topic for online/offline status (#8593)
abmantis Jul 27, 2017
1e8c00a
Adding support for mapping keys to value in statsd (#8665)
Khabi Jul 27, 2017
b59c299
Upgrade fuzzywuzzy to 0.15.1 (#8671)
fabaff Jul 27, 2017
4fcaea2
Upgrade libnacl to 1.5.2 (#8670)
fabaff Jul 27, 2017
74581b5
Upgrade sqlalchemy to 1.1.12 (#8669)
fabaff Jul 27, 2017
9e6817b
Upgrade pyhomematic to 0.1.30 (#8673)
danielperna84 Jul 27, 2017
51108b8
Hass.io: logo support / timeout handling (#8668)
pvizeli Jul 27, 2017
0ab0e35
Updated pysnmp to 4.3.9 (#8675)
bgehrich Jul 27, 2017
e8ce418
Fix COMMAND_CLASS_BARRIER_OPERATOR for dev branch of OpenZwave (#8574)
firstof9 Jul 27, 2017
0c97fe7
Version bump to 0.50
Jul 28, 2017
0a6d519
Merge remote-tracking branch 'origin/master' into release-0-50
Jul 28, 2017
828c469
Fix Lint
balloob Jul 29, 2017
56f4486
Update frontend
balloob Jul 29, 2017
f0e5f68
Shopping List: edit name / complete status (#8666)
balloob Jul 29, 2017
c376bc2
Support for Wink local control (#8607)
Jul 28, 2017
12dec93
Update frontend
balloob Jul 29, 2017
a760673
Persist shopping list + clear completed (#8697)
balloob Jul 29, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix COMMAND_CLASS_BARRIER_OPERATOR for dev branch of OpenZwave (#8574)
* Update zwave.py to work with updated OpenZwave library

Update zwave.py to work with updated OpenZwave library

* Update zwave.py

* Update zwave.py

* Update to fix garage door openers

Update to fix garage door support for latest version of openzwavelib

* Update to cover.zwave list of states

Update to cover.zwave to provide list of states based on dev version of
openzwave lib

* Some values not saved

* Formatting fix

* Formatting fix

* Variable typo

* Formatting fix

* Formatting

* Variable Update

Variable Update and properties added

* Formatting fixes

* Formatting Fix

* Update test case for door states

* Formatting / Testing process fix

* Formatting

* Formatting / Test Fixes

* Variable rename

* Added members to CoverDevice

* Removed un-needed else

* Formatting

* Formatting

* Variable name changes and const updates

* Changed variable names to cover_state
* Added constains into const.py
* Updated to change the main state on the cover device

* Fixes

* Formatting fixes

* Formatting/Variables

* Formatting

* Variable fixes

* Import update

* Formatting  / Variables

* Update test for new states

* Revert state changes

* Test fix

* Variable Fix

* Formatting

* Variable typo

* Missing constant

* Variable fix

* Requested changes

* Added is_opening
* Added is_closing
* Updated test based on changes

* Formatting

* Changed cover_state back to _state

* Formatting and variable fixes

* Test fixes

* Formatting and variable touchup

* Formatting

* Optimizations

* Add new cover features to demo

* Add tests for demo cover closing/opening

* Remove unused STATE_STOPPED

* Add tests for new zwave cover values
  • Loading branch information
firstof9 authored and emlove committed Jul 27, 2017
commit e8ce41874c8b637f666ab8809ff40be75c48221e
17 changes: 16 additions & 1 deletion homeassistant/components/cover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
SERVICE_OPEN_COVER, SERVICE_CLOSE_COVER, SERVICE_SET_COVER_POSITION,
SERVICE_STOP_COVER, SERVICE_OPEN_COVER_TILT, SERVICE_CLOSE_COVER_TILT,
SERVICE_STOP_COVER_TILT, SERVICE_SET_COVER_TILT_POSITION, STATE_OPEN,
STATE_CLOSED, STATE_UNKNOWN, ATTR_ENTITY_ID)
STATE_CLOSED, STATE_UNKNOWN, STATE_OPENING, STATE_CLOSING, ATTR_ENTITY_ID)

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -225,6 +225,11 @@ def current_cover_tilt_position(self):
@property
def state(self):
"""Return the state of the cover."""
if self.is_opening:
return STATE_OPENING
if self.is_closing:
return STATE_CLOSING

closed = self.is_closed

if closed is None:
Expand Down Expand Up @@ -262,6 +267,16 @@ def supported_features(self):

return supported_features

@property
def is_opening(self):
"""Return if the cover is opening or not."""
pass

@property
def is_closing(self):
"""Return if the cover is closing or not."""
pass

@property
def is_closed(self):
"""Return if the cover is closed or not."""
Expand Down
38 changes: 28 additions & 10 deletions homeassistant/components/cover/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ def __init__(self, hass, name, position=None, tilt_position=None,
self._set_position = None
self._set_tilt_position = None
self._tilt_position = tilt_position
self._closing = True
self._closing_tilt = True
self._requested_closing = True
self._requested_closing_tilt = True
self._unsub_listener_cover = None
self._unsub_listener_cover_tilt = None
self._is_opening = False
self._is_closing = False
if position is None:
self._closed = True
else:
Expand Down Expand Up @@ -69,6 +71,16 @@ def is_closed(self):
"""Return if the cover is closed."""
return self._closed

@property
def is_closing(self):
"""Return if the cover is closing."""
return self._is_closing

@property
def is_opening(self):
"""Return if the cover is opening."""
return self._is_opening

@property
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
Expand All @@ -90,16 +102,18 @@ def close_cover(self, **kwargs):
self.schedule_update_ha_state()
return

self._is_closing = True
self._listen_cover()
self._closing = True
self._requested_closing = True
self.schedule_update_ha_state()

def close_cover_tilt(self, **kwargs):
"""Close the cover tilt."""
if self._tilt_position in (0, None):
return

self._listen_cover_tilt()
self._closing_tilt = True
self._requested_closing_tilt = True

def open_cover(self, **kwargs):
"""Open the cover."""
Expand All @@ -110,16 +124,18 @@ def open_cover(self, **kwargs):
self.schedule_update_ha_state()
return

self._is_opening = True
self._listen_cover()
self._closing = False
self._requested_closing = False
self.schedule_update_ha_state()

def open_cover_tilt(self, **kwargs):
"""Open the cover tilt."""
if self._tilt_position in (100, None):
return

self._listen_cover_tilt()
self._closing_tilt = False
self._requested_closing_tilt = False

def set_cover_position(self, position, **kwargs):
"""Move the cover to a specific position."""
Expand All @@ -128,7 +144,7 @@ def set_cover_position(self, position, **kwargs):
return

self._listen_cover()
self._closing = position < self._position
self._requested_closing = position < self._position

def set_cover_tilt_position(self, tilt_position, **kwargs):
"""Move the cover til to a specific position."""
Expand All @@ -137,10 +153,12 @@ def set_cover_tilt_position(self, tilt_position, **kwargs):
return

self._listen_cover_tilt()
self._closing_tilt = tilt_position < self._tilt_position
self._requested_closing_tilt = tilt_position < self._tilt_position

def stop_cover(self, **kwargs):
"""Stop the cover."""
self._is_closing = False
self._is_opening = False
if self._position is None:
return
if self._unsub_listener_cover is not None:
Expand All @@ -166,7 +184,7 @@ def _listen_cover(self):

def _time_changed_cover(self, now):
"""Track time changes."""
if self._closing:
if self._requested_closing:
self._position -= 10
else:
self._position += 10
Expand All @@ -186,7 +204,7 @@ def _listen_cover_tilt(self):

def _time_changed_cover_tilt(self, now):
"""Track time changes."""
if self._closing_tilt:
if self._requested_closing_tilt:
self._tilt_position -= 10
else:
self._tilt_position += 10
Expand Down
18 changes: 15 additions & 3 deletions homeassistant/components/cover/zwave.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,36 @@ class ZwaveGarageDoor(zwave.ZWaveDeviceEntity, CoverDevice):
def __init__(self, values):
"""Initialize the zwave garage door."""
ZWaveDeviceEntity.__init__(self, values, DOMAIN)
self._state = None
self.update_properties()

def update_properties(self):
"""Handle data changes for node values."""
self._state = self.values.primary.data
_LOGGER.debug("self._state=%s", self._state)

@property
def is_opening(self):
"""Return true if cover is in an opening state."""
return self._state == "Opening"

@property
def is_closing(self):
"""Return true if cover is in an closing state."""
return self._state == "Closing"

@property
def is_closed(self):
"""Return the current position of Zwave garage door."""
return not self._state
return self._state == "Closed"

def close_cover(self):
"""Close the garage door."""
self.values.primary.data = False
self.values.primary.data = "Closed"

def open_cover(self):
"""Open the garage door."""
self.values.primary.data = True
self.values.primary.data = "Opened"

@property
def device_class(self):
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@
STATE_NOT_HOME = 'not_home'
STATE_UNKNOWN = 'unknown'
STATE_OPEN = 'open'
STATE_OPENING = 'opening'
STATE_CLOSED = 'closed'
STATE_CLOSING = 'closing'
STATE_PLAYING = 'playing'
STATE_PAUSED = 'paused'
STATE_IDLE = 'idle'
Expand Down
8 changes: 8 additions & 0 deletions tests/components/cover/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,37 @@ def test_supported_features(self):
def test_close_cover(self):
"""Test closing the cover."""
state = self.hass.states.get(ENTITY_COVER)
self.assertEqual(state.state, 'open')
self.assertEqual(70, state.attributes.get('current_position'))
cover.close_cover(self.hass, ENTITY_COVER)
self.hass.block_till_done()
state = self.hass.states.get(ENTITY_COVER)
self.assertEqual(state.state, 'closing')
for _ in range(7):
future = dt_util.utcnow() + timedelta(seconds=1)
fire_time_changed(self.hass, future)
self.hass.block_till_done()

state = self.hass.states.get(ENTITY_COVER)
self.assertEqual(state.state, 'closed')
self.assertEqual(0, state.attributes.get('current_position'))

def test_open_cover(self):
"""Test opening the cover."""
state = self.hass.states.get(ENTITY_COVER)
self.assertEqual(state.state, 'open')
self.assertEqual(70, state.attributes.get('current_position'))
cover.open_cover(self.hass, ENTITY_COVER)
self.hass.block_till_done()
state = self.hass.states.get(ENTITY_COVER)
self.assertEqual(state.state, 'opening')
for _ in range(7):
future = dt_util.utcnow() + timedelta(seconds=1)
fire_time_changed(self.hass, future)
self.hass.block_till_done()

state = self.hass.states.get(ENTITY_COVER)
self.assertEqual(state.state, 'open')
self.assertEqual(100, state.attributes.get('current_position'))

def test_set_cover_position(self):
Expand Down
27 changes: 21 additions & 6 deletions tests/components/cover/test_zwave.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,31 +161,46 @@ def test_roller_reverse_open_close(hass, mock_openzwave):
def test_garage_value_changed(hass, mock_openzwave):
"""Test position changed."""
node = MockNode()
value = MockValue(data=False, node=node,
value = MockValue(data="Closed", node=node,
command_class=const.COMMAND_CLASS_BARRIER_OPERATOR)
values = MockEntityValues(primary=value, node=node)
device = zwave.get_device(hass=hass, node=node, values=values,
node_config={})

assert device.is_closed
assert not device.is_opening
assert not device.is_closing

value.data = True
value.data = "Opening"
value_changed(value)
assert not device.is_closed
assert device.is_opening
assert not device.is_closing

value.data = "Opened"
value_changed(value)
assert not device.is_closed
assert not device.is_opening
assert not device.is_closing

value.data = "Closing"
value_changed(value)
assert not device.is_closed
assert not device.is_opening
assert device.is_closing


def test_garage_commands(hass, mock_openzwave):
"""Test position changed."""
node = MockNode()
value = MockValue(data=False, node=node,
value = MockValue(data="Closed", node=node,
command_class=const.COMMAND_CLASS_BARRIER_OPERATOR)
values = MockEntityValues(primary=value, node=node)
device = zwave.get_device(hass=hass, node=node, values=values,
node_config={})

assert value.data is False
assert value.data == "Closed"
device.open_cover()
assert value.data is True
assert value.data == "Opened"
device.close_cover()
assert value.data is False
assert value.data == "Closed"