mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add mac address to sky_hub tracker (#39506)
* Add mac address to Sky_Hub tracker * Update manifest.json * Update device_tracker.py * Update device_tracker.py * Update device_tracker.py * Apply suggestions from code review Co-authored-by: Chris Talkington <chris@talkingtontech.com>
This commit is contained in:
parent
01bac9f433
commit
0d3396ed64
@ -44,11 +44,25 @@ class SkyHubDeviceScanner(DeviceScanner):
|
||||
async def async_scan_devices(self):
|
||||
"""Scan for new devices and return a list with found device IDs."""
|
||||
await self._async_update_info()
|
||||
return list(self.last_results)
|
||||
return [device.mac for device in self.last_results]
|
||||
|
||||
async def async_get_device_name(self, device):
|
||||
"""Return the name of the given device."""
|
||||
return self.last_results.get(device)
|
||||
name = next(
|
||||
(result.name for result in self.last_results if result.mac == device),
|
||||
None,
|
||||
)
|
||||
return name
|
||||
|
||||
async def async_get_extra_attributes(self, device):
|
||||
"""Get extra attributes of a device."""
|
||||
device = next(
|
||||
(result for result in self.last_results if result.mac == device), None
|
||||
)
|
||||
if device is None:
|
||||
return {}
|
||||
|
||||
return device.asdict()
|
||||
|
||||
async def _async_update_info(self):
|
||||
"""Ensure the information from the Sky Hub is up to date."""
|
||||
|
@ -2,6 +2,6 @@
|
||||
"domain": "sky_hub",
|
||||
"name": "Sky Hub",
|
||||
"documentation": "https://www.home-assistant.io/integrations/sky_hub",
|
||||
"requirements": ["pyskyqhub==0.1.1"],
|
||||
"requirements": ["pyskyqhub==0.1.2"],
|
||||
"codeowners": ["@rogerselwyn"]
|
||||
}
|
||||
|
@ -1622,7 +1622,7 @@ pysher==1.0.1
|
||||
pysignalclirestapi==0.3.4
|
||||
|
||||
# homeassistant.components.sky_hub
|
||||
pyskyqhub==0.1.1
|
||||
pyskyqhub==0.1.2
|
||||
|
||||
# homeassistant.components.sma
|
||||
pysma==0.3.5
|
||||
|
Loading…
x
Reference in New Issue
Block a user