hon icon indicating copy to clipboard operation
hon copied to clipboard

BUG Allowed: min 1 max 3 step 1

Open andreadegiovine opened this issue 1 year ago • 6 comments

Hi, when try to start a program on my HWPD 69AMBC/1-S (washing machine) an error occured:

Allowed: min 1 max 3 step 1

when integration set the defaults params values:

/config/custom_components/hon/device.py::start_command()
...
self.update_command(command, self.attributes["parameters"])
...

The fix is to use a min value instead trow the error here:

/config/custom_components/hon/parameter.py::106

...
raise ValueError(f"Allowed: min {self._min} max {self._max} step {self._step}")
...
to
...
self._value = self._min
...

andreadegiovine avatar May 23 '24 08:05 andreadegiovine

just to understand, how do you start the program ? because normally they all have default values that match with what is expected

gvigroux avatar Jun 10 '24 15:06 gvigroux

I checked and I cannot do the modification because this piece of code is used in a lot of context (like setting the temperature). I've added one log to understand the value passed.

How do you start the program ?

gvigroux avatar Jun 18 '24 08:06 gvigroux

I'm having the same issue with my HD 496AMBCB/1-80 washer dryer (otherwise working well). I've set up a button to perform the action as such:

show_name: true
show_icon: true
type: button
tap_action:
  action: perform-action
  perform_action: hon.start_program
  data:
    program: low_dry
  target:
    device_id: <my_device_id>
icon: mdi:tumble-dryer
layout_options:
  grid_columns: 1
  grid_rows: 2
name: Low heat dry
show_state: true

I am guessing that this should be using the default values: delayTime: [0 - 1410] - Default: 0 - Step: 30 dryLevel: [1, 3, 4] - Default: 4 dryTime: [1 - 4] - Default: 1 - Step: 1 lang: [0 - 25] - Default: 1 - Step: 1

However, even if I specify the parameters such as:

 data:
    program: low_dry
    parameters: >-
      {'delayTime':0,'dryLevel':4,'dryTime':1,'lang':1}

I still get the following error:

Failed to perform the action hon/start_program. Value [0] - Allowed: min 1 max 4 step 1

Any idea what might cause this? Let me know if you need more info @gvigroux

davidanderle avatar Nov 02 '24 19:11 davidanderle

I will release a new version in 10 min that will display the name of the problematic parameter. Let's see after that

gvigroux avatar Feb 21 '25 09:02 gvigroux

I will release a new version in 10 min that will display the name of the problematic parameter. Let's see after that

Hi, I am experiencing the same issue. I tested multiple programs, both with default settings and customized parameters. This update displays the parameters, and it seems that the error parameter is always the first one with a default value that is not zero.

Do you have some suggestions? Thanks a lot!

lukaslinha avatar Feb 22 '25 10:02 lukaslinha