custom-components / grocy

Custom Grocy integration for Home Assistant
Apache License 2.0
164 stars 50 forks source link

Getting product by id fails if name_plural is null #293

Open vorostamas opened 1 year ago

vorostamas commented 1 year ago

Unless all relevant information is provided, I can't help you

Describe the bug If the plural name is not set in Grocy (which is optional), the product sensors are not working.

Expected behavior Working product sensors.

To Reproduce Steps to reproduce the behavior:

  1. Go to /quantityunits
  2. Click on 'Add' button
  3. Type in something in the 'Name in singular form' textbox
  4. Make sure 'Name in plural form' is empty

General information to help debugging:

What sensors do you have enabled? Are they working and/or what state are they in? Do you have the corresponding functions enabled in Grocy?

They are in the Unavailable state, enabled in Grocy.

What is your installed versions of Home Assistant, Grocy and this integration? HA Version: 2023.10.1, Grocy Version 4.0.3, Integration Version: v4.11.1

How do you have Grocy installed? Add-on or external? External

Have you added debugging to the log, and what does the log say? Error fetching grocy data: Update failed: 2 validation errors for ProductDetailsResponse quantity_unit_stock -> name_plural none is not an allowed value (type=type_error.none.not_allowed) default_quantity_unit_purchase -> name_plural none is not an allowed value (type=type_error.none.not_allowed)

Additional context

This is already done in pygrocy: https://github.com/SebRut/pygrocy/issues/271