@@ -115,6 +115,17 @@ async def test_validate_api_section_no_api_data() -> None:
115115 await bsblan ._validator ._validate_api_section ("device" )
116116
117117
118+ @pytest .mark .asyncio
119+ async def test_get_section_params_no_api_data () -> None :
120+ """Test selected section parameter lookup without API data."""
121+ async with aiohttp .ClientSession () as session :
122+ bsblan = BSBLAN (BSBLANConfig (host = "example.com" ), session = session )
123+ bsblan ._api_data = None
124+
125+ with pytest .raises (BSBLANError , match = ErrorMsg .API_DATA_NOT_INITIALIZED ):
126+ bsblan ._validator ._get_section_params ("device" , None )
127+
128+
118129@pytest .mark .asyncio
119130async def test_validate_api_section_invalid_section () -> None :
120131 """Test API section validation with invalid section."""
@@ -235,6 +246,19 @@ async def test_validate_section_already_validated(monkeypatch: Any) -> None:
235246 assert response_data is None
236247
237248
249+ @pytest .mark .asyncio
250+ async def test_validate_api_section_skips_covered_parameters () -> None :
251+ """Test section validation returns when every selected ID is covered."""
252+ async with aiohttp .ClientSession () as session :
253+ bsblan = BSBLAN (BSBLANConfig (host = "example.com" ), session = session )
254+ bsblan ._supports_full_config = True
255+ bsblan ._api_data = {"heating" : {"700" : "operating_mode" }} # type: ignore[assignment]
256+ bsblan ._validator ._api_validator = APIValidator (bsblan ._api_data )
257+ bsblan ._validator ._api_validator .validated_parameters ["heating" ] = {"700" }
258+
259+ assert await bsblan ._validator ._validate_api_section ("heating" ) is None
260+
261+
238262@pytest .mark .asyncio
239263async def test_validation_error_resets_section (monkeypatch : Any ) -> None :
240264 """Test that validation errors reset the section (line 212)."""
0 commit comments