diff --git a/requirements-test.txt b/requirements-test.txt index 60a8409..24fb49d 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,3 +1,4 @@ freezegun==1.5.1 pytest==8.3.2 pytest-asyncio==0.24.0 +aresponses==3.0.0 diff --git a/tests/test_init.py b/tests/test_init.py index 96c21fd..83edeba 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -204,6 +204,28 @@ async def test_daikinSkiFi(aresponses, client_session): aresponses.assert_all_requests_matched() aresponses.assert_no_unused_routes() + assert device.inside_temperature == 23.0 + assert device.target_temperature == 24.0 + assert device.outside_temperature == 0 + + assert device.represent("mode") == ('mode', 'off') + + aresponses.add( + path_pattern="/ac.cgi", + method_pattern="GET", + response="opmode=0&units=.&settemp=20.0&fanspeed=3&fanflags=1&acmode=16&tonact=0&toffact=0&prog=0&time=23:36&day=6&roomtemp=23&outsidetemp=0&louvre=1&zone=0&flt=0&test=0&errdata=146&sensors=1", + ) + aresponses.add( + path_pattern="/set.cgi", + method_pattern="GET", + response="opmode=1&units=.&settemp=20.0&fanspeed=3&fanflags=1&acmode=8&tonact=0&toffact=0&prog=0&time=23:36&day=6&roomtemp=23&outsidetemp=0&louvre=1&zone=0&flt=0&test=0&errdata=146&sensors=1", + ) + + await device.set({"mode": "cool"}) + aresponses.assert_all_requests_matched() + assert device.represent("mode") == ('mode', 'cool') + assert device.target_temperature == 20.0 + @pytest.mark.asyncio async def test_daikinAirBase(aresponses, client_session):