mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Speed up OZW availability check (#38758)
* Speed up OZW availability check * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
016cd8f8ef
commit
f31a580caf
@ -25,6 +25,7 @@ from .const import DOMAIN, PLATFORMS
|
||||
from .discovery import check_node_schema, check_value_schema
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
OZW_READY_STATES_VALUES = {st.value for st in OZW_READY_STATES}
|
||||
|
||||
|
||||
class ZWaveDeviceEntityValues:
|
||||
@ -224,9 +225,7 @@ class ZWaveDeviceEntity(Entity):
|
||||
"""Return entity availability."""
|
||||
# Use OZW Daemon status for availability.
|
||||
instance_status = self.values.primary.ozw_instance.get_status()
|
||||
return instance_status and instance_status.status in (
|
||||
state.value for state in OZW_READY_STATES
|
||||
)
|
||||
return instance_status and instance_status.status in OZW_READY_STATES_VALUES
|
||||
|
||||
@callback
|
||||
def _value_changed(self, value):
|
||||
|
Loading…
x
Reference in New Issue
Block a user