Bump pizzapi to 0.0.6 (#120691)

This commit is contained in:
Joost Lekkerkerker 2024-06-30 15:28:01 +02:00 committed by Franck Nijhof
parent 08a0eaf184
commit 38a30b343d
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
3 changed files with 9 additions and 9 deletions

View File

@ -4,11 +4,11 @@ from datetime import timedelta
import logging import logging
from pizzapi import Address, Customer, Order from pizzapi import Address, Customer, Order
from pizzapi.address import StoreException
import voluptuous as vol import voluptuous as vol
from homeassistant.components import http from homeassistant.components import http
from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import HomeAssistantError
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity_component import EntityComponent
@ -118,7 +118,7 @@ class Dominos:
self.country = conf.get(ATTR_COUNTRY) self.country = conf.get(ATTR_COUNTRY)
try: try:
self.closest_store = self.address.closest_store() self.closest_store = self.address.closest_store()
except StoreException: except Exception: # noqa: BLE001
self.closest_store = None self.closest_store = None
def handle_order(self, call: ServiceCall) -> None: def handle_order(self, call: ServiceCall) -> None:
@ -139,7 +139,7 @@ class Dominos:
"""Update the shared closest store (if open).""" """Update the shared closest store (if open)."""
try: try:
self.closest_store = self.address.closest_store() self.closest_store = self.address.closest_store()
except StoreException: except Exception: # noqa: BLE001
self.closest_store = None self.closest_store = None
return False return False
return True return True
@ -219,7 +219,7 @@ class DominosOrder(Entity):
"""Update the order state and refreshes the store.""" """Update the order state and refreshes the store."""
try: try:
self.dominos.update_closest_store() self.dominos.update_closest_store()
except StoreException: except Exception: # noqa: BLE001
self._orderable = False self._orderable = False
return return
@ -227,13 +227,13 @@ class DominosOrder(Entity):
order = self.order() order = self.order()
order.pay_with() order.pay_with()
self._orderable = True self._orderable = True
except StoreException: except Exception: # noqa: BLE001
self._orderable = False self._orderable = False
def order(self): def order(self):
"""Create the order object.""" """Create the order object."""
if self.dominos.closest_store is None: if self.dominos.closest_store is None:
raise StoreException raise HomeAssistantError("No store available")
order = Order( order = Order(
self.dominos.closest_store, self.dominos.closest_store,
@ -252,7 +252,7 @@ class DominosOrder(Entity):
try: try:
order = self.order() order = self.order()
order.place() order.place()
except StoreException: except Exception: # noqa: BLE001
self._orderable = False self._orderable = False
_LOGGER.warning( _LOGGER.warning(
"Attempted to order Dominos - Order invalid or store closed" "Attempted to order Dominos - Order invalid or store closed"

View File

@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/dominos", "documentation": "https://www.home-assistant.io/integrations/dominos",
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"loggers": ["pizzapi"], "loggers": ["pizzapi"],
"requirements": ["pizzapi==0.0.3"] "requirements": ["pizzapi==0.0.6"]
} }

View File

@ -1557,7 +1557,7 @@ pigpio==1.78
pilight==0.1.1 pilight==0.1.1
# homeassistant.components.dominos # homeassistant.components.dominos
pizzapi==0.0.3 pizzapi==0.0.6
# homeassistant.components.plex # homeassistant.components.plex
plexauth==0.0.6 plexauth==0.0.6