OttPeterR / addon-babybuddy

BabyBuddy, wrapped into a Home Assistant addon
35 stars 13 forks source link

'TypeError: BabyBuddySensor.async_add_diaper_change() got an unexpected keyword argument 'type'' #30

Closed jeroenterheerdt closed 1 year ago

jeroenterheerdt commented 1 year ago

See title - whenever I call the 'Add diaper change' service it returns an 'unknown error' and this is in the logs:

TypeError: BabyBuddySensor.async_add_diaper_change() got an unexpected keyword argument 'type'

I am on the latest Babybuddy add-on version.

jeroenterheerdt commented 1 year ago

was able to resolve this by downgrading the add-on to v2.6.4

OttPeterR commented 1 year ago

I don't believe I've messed around with how HA passes parameters to BB service calls, so my gut reaction is to think this is being caused by something else. But fixing the issue by downgrading does make it seem like it's the add-on's fault. I'm running the up-to-date addon and I do not see the issue. Here's an automation I have with that type parameter that doesn't error (for me), not sure if it'll be too much helps since its just the basics, but it's what I have working:

service: babybuddy.add_diaper_change
target:
  entity_id: sensor.my_baby_1
data:
  type: Solid
  time: "00:00:00"
jeroenterheerdt commented 1 year ago

maybe an upstream change has come in? not sure if 2.6.4. uses a different babybuddy version.

inukai132 commented 1 year ago

I had the same issue with feedings. I had to change type to feed_type There's probably something similar here

EDIT: Found the same issue with submitting a diaper. Changed type to diaper_type and now it works again

OttPeterR commented 1 year ago

I believe that is the solution, you can see the names in the integration code

I'll close this one out for now but feel free to follow up if something else crops up!