Clooos / Bubble-Card

Bubble Card is a minimalist card collection for Home Assistant with a nice pop-up touch.
MIT License
1.98k stars 57 forks source link

slider with climate expected float #768

Open oliiivier opened 2 months ago

oliiivier commented 2 months ago

Describe the bug
A clear and concise description of what the bug is. when I used a slider with my climate thermostat, i've got this error when I slide to change the temperature : Échec de l'appel du service climate/set_temperature. expected float for dictionary value @ data['temperature']

YAML

my button :

  - type: custom:bubble-card
    card_type: button
    button_type: slider
    entity: climate.chauffage_chambre_5
    icon: mdi:heat-wave
    attribute: temperature
    show_state: true
    show_attribute: true
    force_icon: false

my climate :

 - platform: smart_thermostat
    name: Chauffage Chambre 5
    heater: switch.chauffage_chambre_5
    target_sensor: sensor.temperature_chambre_5_temperature
    min_temp: 15
    max_temp: 25
    ac_mode: False
    target_temp: 19
    keep_alive:
      seconds: 60
    away_temp: 14
    kp: 50
    ki: 0.01
    kd: 2000
    pwm: 00:15:00

Informations (please complete the following information):

Thank you! 🍻

Marmelatze commented 1 month ago

looks like if target_temp_step is not set for the climate attribut falls back to an empty string and not 0.5: https://github.com/Clooos/Bubble-Card/blob/main/src/cards/button/helpers.ts#L54

Clooos commented 1 month ago

Hi! Thank you for your help @Marmelatze! Don't hesitate to do a pull request if you have some time for that! 👌

1rfsNet commented 1 month ago

I do have the same issue. I have two different types of climate devices, one with _target_tempstep (working fine) and one without (not working, same error like @oliiivier).

Unfortunately, I have little experience with programming in HA, but would replacing the ?? with || solve the problem? https://github.com/Clooos/Bubble-Card/blob/main/src/cards/button/helpers.ts#L146

Clooos commented 1 month ago

I'm on it! I forgot to fix it in the previous beta but it will be fixed in the next one! I'm also finally working on a climate card with buttons! So just wait for it 😁