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
Add hive boost to climate and water_heater #26789
Merged
MartinHjelmare
merged 33 commits into
home-assistant:dev
from
Rendili:feature/add_boost
Sep 27, 2019
Merged
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
3da4e2a
Start the Boost work
40546d0
Add services.yaml
55f1c07
Added Services #2
9ecbc49
Start the Boost work
a6ec9df
Add services.yaml
8d1d373
Added Services #2
4a0433a
Merge branch 'feature/add_boost' of github.com:KJonline/home-assistan…
a1eb496
Working Services
917d290
Merge branch 'dev' into feature/add_boost
2f37b6c
pyhiveapi to 0.2.19
Rendili 43199ff
Update Libary to 0.2.19
2fddd8c
Merge branch 'feature/add_boost' of github.com:KJonline/home-assistan…
5b37b27
Merge branch 'dev' into feature/add_boost
6488112
Update Water_heater boost
Rendili 17f0e26
Added Async hass add function
9576209
Update Services
ca26b29
Merge branch 'dev' into feature/add_boost
3c37392
MERGED
6faac31
Reviewed Changes
b7c5d85
Fixed Refresh System
aad3aad
Review 2
d4db766
Moved device iteration to the platform
aa92c41
update
adcd69c
Updates #2
4922ae4
Review#3 New Base Class
f2eb368
Review #5
b3d91a2
Merge branch 'dev' into feature/add_boost
36b8516
Update homeassistant/components/hive/__init__.py
c95027a
Update homeassistant/components/hive/__init__.py
5084044
Update homeassistant/components/hive/__init__.py
73da60c
Review 6
7276045
Review 7
1ed828e
Removed Child classes to inhertit from the parent
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
"""Support for the Hive binary sensors.""" | ||
from homeassistant.components.binary_sensor import BinarySensorDevice | ||
|
||
from . import DATA_HIVE, DOMAIN | ||
from . import DOMAIN, DATA_HIVE, HiveEntity | ||
|
||
DEVICETYPE_DEVICE_CLASS = {"motionsensor": "motion", "contactsensor": "opening"} | ||
|
||
|
@@ -10,25 +10,20 @@ def setup_platform(hass, config, add_entities, discovery_info=None): | |
"""Set up Hive sensor devices.""" | ||
if discovery_info is None: | ||
return | ||
session = hass.data.get(DATA_HIVE) | ||
|
||
add_entities([HiveBinarySensorEntity(session, discovery_info)]) | ||
session = hass.data.get(DATA_HIVE) | ||
devs = [] | ||
for dev in discovery_info: | ||
devs.append(HiveBinarySensorEntity(session, dev)) | ||
add_entities(devs) | ||
|
||
|
||
class HiveBinarySensorEntity(BinarySensorDevice): | ||
class HiveBinarySensorEntity(HiveEntity, BinarySensorDevice): | ||
"""Representation of a Hive binary sensor.""" | ||
|
||
def __init__(self, hivesession, hivedevice): | ||
def __init__(self, hive_session, hive_device): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this. |
||
"""Initialize the hive sensor.""" | ||
self.node_id = hivedevice["Hive_NodeID"] | ||
self.node_name = hivedevice["Hive_NodeName"] | ||
self.device_type = hivedevice["HA_DeviceType"] | ||
self.node_device_type = hivedevice["Hive_DeviceType"] | ||
self.session = hivesession | ||
self.attributes = {} | ||
self.data_updatesource = f"{self.device_type}.{self.node_id}" | ||
self._unique_id = f"{self.node_id}-{self.device_type}" | ||
self.session.entities.append(self) | ||
super().__init__(hive_session, hive_device) | ||
|
||
@property | ||
def unique_id(self): | ||
|
@@ -40,11 +35,6 @@ def device_info(self): | |
"""Return device information.""" | ||
return {"identifiers": {(DOMAIN, self.unique_id)}, "name": self.name} | ||
|
||
def handle_update(self, updatesource): | ||
"""Handle the new update request.""" | ||
if f"{self.device_type}.{self.node_id}" not in updatesource: | ||
self.schedule_update_ha_state() | ||
|
||
@property | ||
def device_class(self): | ||
"""Return the class of this sensor.""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed during the review of the documentation:
hotwater
is not one word. So I expected it to behot_water
?