mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00: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:
parent
7de509dc76
commit
4984030871
@ -80,6 +80,9 @@ class Geizwatch(Entity):
|
|||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
"""Return the best price of the selected product."""
|
"""Return the best price of the selected product."""
|
||||||
|
if not self._device.prices:
|
||||||
|
return None
|
||||||
|
|
||||||
return self._device.prices[0]
|
return self._device.prices[0]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user