diff --git a/custom_components/grocy/json_encode.py b/custom_components/grocy/json_encode.py index 6c55f00..96ce211 100644 --- a/custom_components/grocy/json_encode.py +++ b/custom_components/grocy/json_encode.py @@ -4,6 +4,7 @@ from typing import Any from pygrocy.data_models.product import ProductBarcode +from pygrocy.grocy_api_client import ProductBarcodeData class GrocyJSONEncoder(json.JSONEncoder): @@ -14,6 +15,8 @@ def default(self, o: Any) -> Any: if isinstance(o, ProductBarcode): return o.barcode + if isinstance(o, ProductBarcodeData): + return o.barcode if isinstance(o, datetime): return o.isoformat() if isinstance(o, set):