소스 검색

HA 2023.9.0 has altered the config flow return values.

Config flow tests need updating to include the new "preview" entry
that is being returned.

Update version required to ensure older versions that do not have this
are not used for the tests.  Since we don't make use of it, this does
not affect the version of HA needed by end users at runtime, only the
automated tests.

- minor update to Ditua config: HSV ranges should start from 0 not 1.
Jason Rumney 2 년 전
부모
커밋
94eb89a5ca
3개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 3
      custom_components/tuya_local/devices/ditua_dt1522yn_aromadiffuser.yaml
  2. 1 1
      requirements-dev.txt
  3. 3 0
      tests/test_config_flow.py

+ 3 - 3
custom_components/tuya_local/devices/ditua_dt1522yn_aromadiffuser.yaml

@@ -48,17 +48,17 @@ secondary_entities:
           - name: h
           - name: h
             bytes: 2
             bytes: 2
             range:
             range:
-              min: 1
+              min: 0
               max: 360
               max: 360
           - name: s
           - name: s
             bytes: 1
             bytes: 1
             range:
             range:
-              min: 1
+              min: 0
               max: 255
               max: 255
           - name: v
           - name: v
             bytes: 1
             bytes: 1
             range:
             range:
-              min: 1
+              min: 0
               max: 255
               max: 255
       - id: 109
       - id: 109
         type: string
         type: string

+ 1 - 1
requirements-dev.txt

@@ -2,7 +2,7 @@ black
 fuzzywuzzy
 fuzzywuzzy
 isort
 isort
 levenshtein
 levenshtein
-pytest-homeassistant-custom-component~=0.13.49
+pytest-homeassistant-custom-component~=0.13.54
 pytest
 pytest
 pytest-asyncio
 pytest-asyncio
 pytest-cov
 pytest-cov

+ 3 - 0
tests/test_config_flow.py

@@ -228,6 +228,7 @@ async def test_flow_user_init(hass):
         "step_id": "user",
         "step_id": "user",
         "type": "form",
         "type": "form",
         "last_step": ANY,
         "last_step": ANY,
+        "preview": ANY,
     }
     }
     assert expected == result
     assert expected == result
     # Check the schema.  Simple comparison does not work since they are not
     # Check the schema.  Simple comparison does not work since they are not
@@ -379,6 +380,7 @@ async def test_flow_select_type_init(mock_device, hass):
         "step_id": "select_type",
         "step_id": "select_type",
         "type": "form",
         "type": "form",
         "last_step": ANY,
         "last_step": ANY,
+        "preview": ANY,
     }
     }
     assert expected == result
     assert expected == result
     # Check the schema.  Simple comparison does not work since they are not
     # Check the schema.  Simple comparison does not work since they are not
@@ -443,6 +445,7 @@ async def test_flow_choose_entities_init(hass):
         "step_id": "choose_entities",
         "step_id": "choose_entities",
         "type": "form",
         "type": "form",
         "last_step": ANY,
         "last_step": ANY,
+        "preview": ANY,
     }
     }
     assert expected == result
     assert expected == result
     # Check the schema.  Simple comparison does not work since they are not
     # Check the schema.  Simple comparison does not work since they are not