MindrustUK / Heatmiser-for-home-assistant

Heatmiser Neo-Hub / Neostat support for home-assistant.io
87 stars 32 forks source link

Hold Function not working with int #185

Closed zaidbadat closed 1 week ago

zaidbadat commented 2 weeks ago

If setting the hold temp to 21 it doesn’t work, setting it to 21.0 doesn’t work either, but setting as 21.5 works fine.

IMG_1219 IMG_1220

MindrustUK commented 2 weeks ago

@zaidbadat Have you tried setting 21.0 ? Does this work for you, the type was recently changed to support floats rather than int.

MindrustUK commented 2 weeks ago

@zaidbadat Sorry, just read that you tried this. Odd... I'll investigate.

MindrustUK commented 2 weeks ago

Strange, I can only assume that 22.0 is being interpreted as a int rather than a float, which makes sense but it does call into question how typing should work... I might need to add something to wrap the value to always return a float. I'll investigate further when I get some time. Thanks for reporting.

zaidbadat commented 2 weeks ago

Thank you.

If it helps I’ve attached images of the version I’m running.

zaidbadat commented 2 weeks ago

IMG_1221 IMG_1222

ocrease commented 2 weeks ago

@MindrustUK looks like I didn't do very good testing on #175. I think the schema for the service call needs to change:

platform.async_register_entity_service(
    SERVICE_HOLD_ON,
    {
        vol.Required(ATTR_HOLD_DURATION, default=1): object,
        vol.Required(ATTR_HOLD_TEMPERATURE, default=20): vol.Coerce(float),
    },
    "set_hold",
)

Using vol.Coerce(float) instead of float should allow int, float and strings that are numbers.

zaidbadat commented 2 weeks ago

Any idea when this fix is likely to be pushed, please.  We rely on this extension to control our UFH, it would be appreciated.  Thank you. 

On Friday, October 18, 2024, 3:52 pm, ocrease @.***> wrote:

@MindrustUK looks like I didn't do very good testing on #175. I think the schema for the service call needs to change: platform.async_register_entity_service( SERVICE_HOLD_ON, { vol.Required(ATTR_HOLD_DURATION, default=1): object, vol.Required(ATTR_HOLD_TEMPERATURE, default=20): vol.Coerce(float), }, "set_hold", )

Using vol.Coerce(float) instead of float should allow int, float and strings that are numbers.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

111rdw commented 1 week ago

I'm having hte same problem. Tried to change my config file as you reccommend but it did not work. I'm a complete amateur at this so might have got it wrong. this is what it did

platform.async_register_entity_service( SERVICE_HOLD_ON, { vol.Required(ATTR_HOLD_DURATION, default=1): object, vol.Required(ATTR_HOLD_TEMPERATURE, default=20): vol.Coerce(float), }, "set_hold",

I will change my target temp to x.1 in the interim. thanks

MindrustUK commented 1 week ago

@ocrease Pushed that hotfix. Looks like it's working for me. I'll leave the issue open for a few days for feedback if anyone has further issues.

ocrease commented 1 week ago

@MindrustUK seems to be working for me too.

@111rdw make sure you restart home assistant after updating. Also, in HACS I had to do "Update information" to get the right version (commit 7fe9630)

zaidbadat commented 1 week ago

Working for me now too, thank you. 

On Sunday, October 20, 2024, 3:19 pm, ocrease @.***> wrote:

@MindrustUK seems to be working for me too.

@111rdw make sure you restart home assistant after updating. Also, in HACS I had to do "Update information" to get the right version (commit 7fe9630)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

111rdw commented 1 week ago

@MindrustUK seems to be working for me too.

@111rdw make sure you restart home assistant after updating. Also, in HACS I had to do "Update information" to get the right version (commit 7fe9630)

Many thanks. Reboot and right version fixed it. Happy days👍👍👍

MindrustUK commented 1 week ago

Great, thanks for the feedback. closing resolved.