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>
pull/92818/head^2
Dominik 2023-05-31 15:17:23 +02:00 committed by GitHub
parent 1d7498378e
commit c8c368340d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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