mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
UniFi - Log better information than a backtrace when poor switch data is involved (#31382)
This commit is contained in:
parent
43b11f6b39
commit
1edaae34c5
@ -216,7 +216,15 @@ class UniFiPOEClientSwitch(UniFiClient, SwitchDevice, RestoreEntity):
|
|||||||
@property
|
@property
|
||||||
def port(self):
|
def port(self):
|
||||||
"""Shortcut to the switch port that client is connected to."""
|
"""Shortcut to the switch port that client is connected to."""
|
||||||
return self.device.ports[self.client.sw_port]
|
try:
|
||||||
|
return self.device.ports[self.client.sw_port]
|
||||||
|
except TypeError:
|
||||||
|
LOGGER.warning(
|
||||||
|
"Entity %s reports faulty device %s or port %s",
|
||||||
|
self.entity_id,
|
||||||
|
self.client.sw_mac,
|
||||||
|
self.client.sw_port,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class UniFiBlockClientSwitch(UniFiClient, SwitchDevice):
|
class UniFiBlockClientSwitch(UniFiClient, SwitchDevice):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user