mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Glances: Improve performance (#93852)
* Improve performance * Apply suggestions from code review Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> --------- Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
1d7498378e
commit
c8c368340d
@ -334,9 +334,9 @@ class GlancesSensor(CoordinatorEntity[GlancesDataUpdateCoordinator], SensorEntit
|
|||||||
if super().available:
|
if super().available:
|
||||||
return (
|
return (
|
||||||
not self._numeric_state_expected
|
not self._numeric_state_expected
|
||||||
or isinstance(self.native_value, (int, float))
|
or isinstance(value := self.native_value, (int, float))
|
||||||
or isinstance(self.native_value, str)
|
or isinstance(value, str)
|
||||||
and self.native_value.isnumeric()
|
and value.isnumeric()
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user