mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 19:25:12 +02:00
Fix geizhals crash if no price found (#19197)
* Fix geizhals crash if no price found * Return None on unknown price. * Linting * Linting the linting
This commit is contained in:
committed by
Fabian Affolter
parent
7de509dc76
commit
4984030871
@@ -80,6 +80,9 @@ class Geizwatch(Entity):
|
||||
@property
|
||||
def state(self):
|
||||
"""Return the best price of the selected product."""
|
||||
if not self._device.prices:
|
||||
return None
|
||||
|
||||
return self._device.prices[0]
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user