From c8c368340ddef3623ad798768d927876df6a06ed Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 31 May 2023 15:17:23 +0200 Subject: [PATCH] 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> --- homeassistant/components/glances/sensor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/glances/sensor.py b/homeassistant/components/glances/sensor.py index 4d2546dac58..f4a3f882749 100644 --- a/homeassistant/components/glances/sensor.py +++ b/homeassistant/components/glances/sensor.py @@ -334,9 +334,9 @@ class GlancesSensor(CoordinatorEntity[GlancesDataUpdateCoordinator], SensorEntit if super().available: return ( not self._numeric_state_expected - or isinstance(self.native_value, (int, float)) - or isinstance(self.native_value, str) - and self.native_value.isnumeric() + or isinstance(value := self.native_value, (int, float)) + or isinstance(value, str) + and value.isnumeric() ) return False