@@ -31,7 +31,9 @@ export interface ClimateState {
3131 target_temp_high ?: number ;
3232 target_temp_low ?: number ;
3333 target_humidity ?: number ;
34+ humidity_step ?: number ;
3435 current_humidity ?: number ;
36+ temperature_step ?: number ;
3537 min_temp : number ;
3638 max_temp : number ;
3739 min_humidity ?: number ;
@@ -444,6 +446,7 @@ export class ClimateControlDialog extends LitElement {
444446 }
445447
446448 const isNoTempChange = this . _isNoTemperatureChangeEnabled ( ) ;
449+ const temperatureStep = this . _getTemperatureStep ( ) ;
447450 const { min_temp, max_temp, temperature } = this . stateObj . attributes ;
448451 const range = max_temp - min_temp ;
449452 const tempPercent = ( ( temperature ! - min_temp ) / range ) * 100 ;
@@ -483,7 +486,7 @@ export class ClimateControlDialog extends LitElement {
483486 class ="dual-range-input ${ inputClass } "
484487 min ="${ min_temp } "
485488 max ="${ max_temp } "
486- step ="0.5 "
489+ step ="${ temperatureStep } "
487490 ?disabled =${ isNoTempChange }
488491 .value ="${ temperature } "
489492 @input=${ this . _handleTempSlider }
@@ -501,6 +504,7 @@ export class ClimateControlDialog extends LitElement {
501504 }
502505
503506 const isNoTempChange = this . _isNoTemperatureChangeEnabled ( ) ;
507+ const temperatureStep = this . _getTemperatureStep ( ) ;
504508 const { min_temp, max_temp, target_temp_low, target_temp_high } = this . stateObj . attributes ;
505509 const range = max_temp - min_temp ;
506510 const lowPercent = ( ( target_temp_low ! - min_temp ) / range ) * 100 ;
@@ -532,7 +536,7 @@ export class ClimateControlDialog extends LitElement {
532536 class ="dual-range-input heating "
533537 min ="${ min_temp } "
534538 max ="${ max_temp } "
535- step ="0.5 "
539+ step ="${ temperatureStep } "
536540 ?disabled =${ isNoTempChange }
537541 .value ="${ target_temp_low } "
538542 @input=${ this . _handleTempLowSlider }
@@ -562,7 +566,7 @@ export class ClimateControlDialog extends LitElement {
562566 class ="dual-range-input cooling "
563567 min ="${ min_temp } "
564568 max ="${ max_temp } "
565- step ="0.5 "
569+ step ="${ temperatureStep } "
566570 ?disabled =${ isNoTempChange }
567571 .value ="${ target_temp_high } "
568572 @input=${ this . _handleTempHighSlider }
@@ -600,7 +604,7 @@ export class ClimateControlDialog extends LitElement {
600604 class ="dual-range-input ${ ! isOffOrAuto ? 'heating' : '' } "
601605 min ="${ min_temp } "
602606 max ="${ max_temp } "
603- step ="0.5 "
607+ step ="${ temperatureStep } "
604608 ?disabled =${ isNoTempChange }
605609 .value ="${ target_temp_low } "
606610 @input=${ this . _handleTempLowSlider }
@@ -611,7 +615,7 @@ export class ClimateControlDialog extends LitElement {
611615 class ="dual-range-input ${ ! isOffOrAuto ? 'cooling' : '' } "
612616 min ="${ min_temp } "
613617 max ="${ max_temp } "
614- step ="0.5 "
618+ step ="${ temperatureStep } "
615619 ?disabled =${ isNoTempChange }
616620 .value ="${ target_temp_high } "
617621 @input=${ this . _handleTempHighSlider }
@@ -628,6 +632,7 @@ export class ClimateControlDialog extends LitElement {
628632 return '' ;
629633 }
630634
635+ const humidityStep = this . _getHumidityStep ( ) ;
631636 const { min_humidity, max_humidity, target_humidity } = this . stateObj . attributes ;
632637 const range = max_humidity ! - min_humidity ! ;
633638 const humidityPercent = ( ( target_humidity ! - min_humidity ! ) / range ) * 100 ;
@@ -648,7 +653,7 @@ export class ClimateControlDialog extends LitElement {
648653 class ="dual-range-input "
649654 min ="${ min_humidity } "
650655 max ="${ max_humidity } "
651- step ="1 "
656+ step ="${ humidityStep } "
652657 .value ="${ target_humidity } "
653658 @input =${ this . _handleHumiditySlider }
654659 style ="top: 0; --track-fill: ${ humidityPercent } %;"
@@ -805,6 +810,22 @@ export class ClimateControlDialog extends LitElement {
805810 return Boolean ( this . stateObj ?. attributes . noChange ) ;
806811 }
807812
813+ private _getTemperatureStep ( ) {
814+ const configuredStep = this . stateObj ?. attributes . temperature_step ;
815+ if ( typeof configuredStep === 'number' && Number . isFinite ( configuredStep ) && configuredStep > 0 ) {
816+ return configuredStep ;
817+ }
818+ return 0.5 ;
819+ }
820+
821+ private _getHumidityStep ( ) {
822+ const configuredStep = this . stateObj ?. attributes . humidity_step ;
823+ if ( typeof configuredStep === 'number' && Number . isFinite ( configuredStep ) && configuredStep > 0 ) {
824+ return configuredStep ;
825+ }
826+ return 1 ;
827+ }
828+
808829 private _renderNoTemperatureChangeToggle ( ) {
809830 if ( ! this . stateObj ) return '' ;
810831
0 commit comments