@@ -438,23 +438,23 @@ async def test_set_away_mode_pessimistic(hass, mqtt_mock):
438438 await hass .async_block_till_done ()
439439
440440 state = hass .states .get (ENTITY_CLIMATE )
441- assert state .attributes .get ("preset_mode" ) is None
441+ assert state .attributes .get ("preset_mode" ) == "none"
442442
443443 await common .async_set_preset_mode (hass , "away" , ENTITY_CLIMATE )
444444 state = hass .states .get (ENTITY_CLIMATE )
445- assert state .attributes .get ("preset_mode" ) is None
445+ assert state .attributes .get ("preset_mode" ) == "none"
446446
447447 async_fire_mqtt_message (hass , "away-state" , "ON" )
448448 state = hass .states .get (ENTITY_CLIMATE )
449449 assert state .attributes .get ("preset_mode" ) == "away"
450450
451451 async_fire_mqtt_message (hass , "away-state" , "OFF" )
452452 state = hass .states .get (ENTITY_CLIMATE )
453- assert state .attributes .get ("preset_mode" ) is None
453+ assert state .attributes .get ("preset_mode" ) == "none"
454454
455455 async_fire_mqtt_message (hass , "away-state" , "nonsense" )
456456 state = hass .states .get (ENTITY_CLIMATE )
457- assert state .attributes .get ("preset_mode" ) is None
457+ assert state .attributes .get ("preset_mode" ) == "none"
458458
459459
460460async def test_set_away_mode (hass , mqtt_mock ):
@@ -467,7 +467,7 @@ async def test_set_away_mode(hass, mqtt_mock):
467467 await hass .async_block_till_done ()
468468
469469 state = hass .states .get (ENTITY_CLIMATE )
470- assert state .attributes .get ("preset_mode" ) is None
470+ assert state .attributes .get ("preset_mode" ) == "none"
471471 await common .async_set_preset_mode (hass , "away" , ENTITY_CLIMATE )
472472 mqtt_mock .async_publish .assert_called_once_with ("away-mode-topic" , "AN" , 0 , False )
473473 mqtt_mock .async_publish .reset_mock ()
@@ -477,7 +477,7 @@ async def test_set_away_mode(hass, mqtt_mock):
477477 await common .async_set_preset_mode (hass , PRESET_NONE , ENTITY_CLIMATE )
478478 mqtt_mock .async_publish .assert_called_once_with ("away-mode-topic" , "AUS" , 0 , False )
479479 state = hass .states .get (ENTITY_CLIMATE )
480- assert state .attributes .get ("preset_mode" ) is None
480+ assert state .attributes .get ("preset_mode" ) == "none"
481481
482482 await common .async_set_preset_mode (hass , "hold-on" , ENTITY_CLIMATE )
483483 mqtt_mock .async_publish .reset_mock ()
@@ -525,7 +525,7 @@ async def test_set_hold_pessimistic(hass, mqtt_mock):
525525
526526 async_fire_mqtt_message (hass , "hold-state" , "off" )
527527 state = hass .states .get (ENTITY_CLIMATE )
528- assert state .attributes .get ("preset_mode" ) is None
528+ assert state .attributes .get ("preset_mode" ) == "none"
529529
530530
531531async def test_set_hold (hass , mqtt_mock ):
@@ -534,7 +534,7 @@ async def test_set_hold(hass, mqtt_mock):
534534 await hass .async_block_till_done ()
535535
536536 state = hass .states .get (ENTITY_CLIMATE )
537- assert state .attributes .get ("preset_mode" ) is None
537+ assert state .attributes .get ("preset_mode" ) == "none"
538538 await common .async_set_preset_mode (hass , "hold-on" , ENTITY_CLIMATE )
539539 mqtt_mock .async_publish .assert_called_once_with ("hold-topic" , "hold-on" , 0 , False )
540540 mqtt_mock .async_publish .reset_mock ()
@@ -550,7 +550,7 @@ async def test_set_hold(hass, mqtt_mock):
550550 await common .async_set_preset_mode (hass , PRESET_NONE , ENTITY_CLIMATE )
551551 mqtt_mock .async_publish .assert_called_once_with ("hold-topic" , "off" , 0 , False )
552552 state = hass .states .get (ENTITY_CLIMATE )
553- assert state .attributes .get ("preset_mode" ) is None
553+ assert state .attributes .get ("preset_mode" ) == "none"
554554
555555
556556async def test_set_preset_mode_twice (hass , mqtt_mock ):
@@ -559,7 +559,7 @@ async def test_set_preset_mode_twice(hass, mqtt_mock):
559559 await hass .async_block_till_done ()
560560
561561 state = hass .states .get (ENTITY_CLIMATE )
562- assert state .attributes .get ("preset_mode" ) is None
562+ assert state .attributes .get ("preset_mode" ) == "none"
563563 await common .async_set_preset_mode (hass , "hold-on" , ENTITY_CLIMATE )
564564 mqtt_mock .async_publish .assert_called_once_with ("hold-topic" , "hold-on" , 0 , False )
565565 mqtt_mock .async_publish .reset_mock ()
@@ -735,15 +735,15 @@ async def test_set_with_templates(hass, mqtt_mock, caplog):
735735 assert state .attributes .get ("temperature" ) == 1031
736736
737737 # Away Mode
738- assert state .attributes .get ("preset_mode" ) is None
738+ assert state .attributes .get ("preset_mode" ) == "none"
739739 async_fire_mqtt_message (hass , "away-state" , '"ON"' )
740740 state = hass .states .get (ENTITY_CLIMATE )
741741 assert state .attributes .get ("preset_mode" ) == "away"
742742
743743 # Away Mode with JSON values
744744 async_fire_mqtt_message (hass , "away-state" , "false" )
745745 state = hass .states .get (ENTITY_CLIMATE )
746- assert state .attributes .get ("preset_mode" ) is None
746+ assert state .attributes .get ("preset_mode" ) == "none"
747747
748748 async_fire_mqtt_message (hass , "away-state" , "true" )
749749 state = hass .states .get (ENTITY_CLIMATE )
0 commit comments