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

Add device_info to Daikin #19372

Merged
merged 2 commits into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions homeassistant/components/climate/daikin.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,8 @@ def swing_list(self):
def update(self):
"""Retrieve latest state."""
self._api.update()

@property
def device_info(self):
"""Return a device description for device registry."""
return self._api.device_info
16 changes: 15 additions & 1 deletion homeassistant/components/daikin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOSTS
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.util import Throttle

Expand Down Expand Up @@ -129,4 +130,17 @@ def update(self, **kwargs):
@property
def mac(self):
"""Return mac-address of device."""
return self.device.values.get('mac')
return self.device.values.get(CONNECTION_NETWORK_MAC)

@property
def device_info(self):
"""Return a device description for device registry."""
info = self.device.values
return {
'connections': {(CONNECTION_NETWORK_MAC, self.mac)},
'identifieres': self.mac,
'manufacturer': 'Daikin',
'model': info.get('model'),
'name': info.get('name'),
'sw_version': info.get('ver').replace('_', '.'),
}
5 changes: 5 additions & 0 deletions homeassistant/components/sensor/daikin.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,8 @@ def unit_of_measurement(self):
def update(self):
"""Retrieve latest state."""
self._api.update()

@property
def device_info(self):
"""Return a device description for device registry."""
return self._api.device_info