Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add water heater management test scripts #34340

Merged
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f9dfb28
Add water heater management test scripts
PeterC1965 Jul 15, 2024
3a803e0
Define runner commands for WHM tests
PeterC1965 Jul 16, 2024
7a3d1ed
Merge branch 'master' into add-water-heater-management-test-scripts
PeterC1965 Jul 18, 2024
cf7844c
Specify --featureSet option on runner command line
PeterC1965 Jul 18, 2024
a4f8ca6
Add the --featureSet option to the RUNNER command line
PeterC1965 Jul 22, 2024
7ca996f
Apply suggestions from code review - corrected test step numbers to a…
jamesharrow Jul 24, 2024
70e516b
Apply suggestions from code review - Changing TestSteps into 3 entries
jamesharrow Jul 24, 2024
50b8a54
Renamed EWATERHTRBase.py to TC_EWATERHTRBase.py. Changed TestStep to …
jamesharrow Jul 24, 2024
1f34ebf
Restyle fix.
jamesharrow Jul 24, 2024
d6b096f
Merge branch 'master' into add-water-heater-management-test-scripts
jamesharrow Jul 24, 2024
10392f7
Update src/python_testing/TC_EWATERHTR_2_1.py
PeterC1965 Jul 25, 2024
65615c2
Start addressing review comments from JamesH
PeterC1965 Jul 25, 2024
e69d58f
Remove water heater management app
PeterC1965 Jul 25, 2024
97a3ec2
Address review comments from JamesH
PeterC1965 Jul 25, 2024
bdb8cc6
Address review comments from JamesH
PeterC1965 Jul 25, 2024
2d9516b
Address review comments from JamesH
PeterC1965 Jul 25, 2024
0ce60d5
Address review comments from JamesH
PeterC1965 Jul 25, 2024
06026e5
Update src/python_testing/TC_EWATERHTR_2_3.py
PeterC1965 Jul 25, 2024
a418517
Update src/python_testing/TC_EWATERHTR_2_3.py
PeterC1965 Jul 25, 2024
86a7090
Update src/python_testing/TC_EWATERHTR_2_3.py
PeterC1965 Jul 25, 2024
774bd7b
Update src/python_testing/TC_EWATERHTR_2_3.py
PeterC1965 Jul 25, 2024
2f0eee7
Update src/python_testing/TC_EWATERHTR_2_3.py
PeterC1965 Jul 25, 2024
2ac5dad
Address review comments from JamesH
PeterC1965 Jul 25, 2024
dda26fe
Restyled by autopep8
restyled-commits Jul 25, 2024
0df10cb
Restyled by isort
restyled-commits Jul 25, 2024
f1be2dc
Merge branch 'master' into add-water-heater-management-test-scripts
PeterC1965 Jul 25, 2024
f0ff08b
Merge branch 'master' into add-water-heater-management-test-scripts
PeterC1965 Jul 25, 2024
55f8cb3
Merge branch 'master' into add-water-heater-management-test-scripts
PeterC1965 Jul 25, 2024
421f3f3
Merge branch 'master' into add-water-heater-management-test-scripts
PeterC1965 Jul 27, 2024
5749641
Merge branch 'master' into add-water-heater-management-test-scripts
PeterC1965 Jul 28, 2024
5dc0d93
Merge branch 'master' into add-water-heater-management-test-scripts
jamesharrow Jul 28, 2024
88088ab
Update src/python_testing/TC_EWATERHTR_2_1.py
jamesharrow Jul 28, 2024
7b2de55
Update src/python_testing/TC_EWATERHTR_2_1.py
jamesharrow Jul 28, 2024
45348d6
Merge branch 'upstream-master' into add-water-heater-management-test-…
jamesharrow Jul 29, 2024
5c3af52
Restored TC_EEVSE_2_4.py from master
jamesharrow Jul 29, 2024
4162238
Fixed issue raised on TC_EWATERHTR_2_1.py about checking that BoostSt…
jamesharrow Jul 29, 2024
b02938d
Merge branch 'master' into add-water-heater-management-test-scripts
PeterC1965 Jul 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 0 additions & 228 deletions src/python_testing/TC_EEVSE_2_4.py

This file was deleted.

94 changes: 94 additions & 0 deletions src/python_testing/TC_EWATERHTRBase.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#
# Copyright (c) 2024 Project CHIP Authors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


import logging
import typing

import chip.clusters as Clusters
from chip.interaction_model import InteractionModelError, Status
from mobly import asserts

logger = logging.getLogger(__name__)


class EWATERHTRBase:

async def read_whm_attribute_expect_success(self, endpoint: int = None, attribute: str = ""):
cluster = Clusters.Objects.WaterHeaterManagement
full_attr = getattr(cluster.Attributes, attribute)
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=full_attr)

async def check_whm_attribute(self, attribute, expected_value, endpoint: int = None):
value = await self.read_whm_attribute_expect_success(endpoint=endpoint, attribute=attribute)
asserts.assert_equal(value, expected_value,
f"Unexpected '{attribute}' value - expected {expected_value}, was {value}")

async def send_boost_command(self, duration: int, one_shot: typing.Optional[bool] = None, emergency_boost: typing.Optional[bool] = None,
temporary_setpoint: typing.Optional[int] = None, target_percentage: typing.Optional[int] = None, target_reheat: typing.Optional[int] = None,
endpoint: int = None, timedRequestTimeoutMs: int = 3000,
expected_status: Status = Status.Success):
try:
await self.send_single_cmd(cmd=Clusters.WaterHeaterManagement.Commands.Boost(
duration=duration,
oneShot=one_shot,
emergencyBoost=emergency_boost,
temporarySetpoint=temporary_setpoint,
targetPercentage=target_percentage,
targetReheat=target_reheat),
endpoint=endpoint,
timedRequestTimeoutMs=timedRequestTimeoutMs)

asserts.assert_equal(expected_status, Status.Success)

except InteractionModelError as e:
asserts.assert_equal(e.status, expected_status, "Unexpected error returned")

async def send_cancel_boost_command(self, endpoint: int = None, timedRequestTimeoutMs: int = 3000,
expected_status: Status = Status.Success):
try:
await self.send_single_cmd(cmd=Clusters.WaterHeaterManagement.Commands.CancelBoost(),
endpoint=endpoint,
timedRequestTimeoutMs=timedRequestTimeoutMs)

asserts.assert_equal(expected_status, Status.Success)

except InteractionModelError as e:
asserts.assert_equal(e.status, expected_status, "Unexpected error returned")

async def send_test_event_trigger_basic_installation_test_event(self):
await self.send_test_event_triggers(eventTrigger=0x0094000000000000)

async def send_test_event_trigger_basic_installation_test_event_clear(self):
await self.send_test_event_triggers(eventTrigger=0x0094000000000001)

async def send_test_event_trigger_water_temperature20C_test_event(self):
await self.send_test_event_triggers(eventTrigger=0x0094000000000002)

async def send_test_event_trigger_water_temperature61C_test_event(self):
await self.send_test_event_triggers(eventTrigger=0x0094000000000003)

async def send_test_event_trigger_water_temperature66C_test_event(self):
await self.send_test_event_triggers(eventTrigger=0x0094000000000004)

async def send_test_event_trigger_manual_mode_test_event(self):
await self.send_test_event_triggers(eventTrigger=0x0094000000000005)

async def send_test_event_trigger_off_mode_test_event(self):
await self.send_test_event_triggers(eventTrigger=0x0094000000000006)

async def send_test_event_trigger_draw_off_hot_water_test_event(self):
await self.send_test_event_triggers(eventTrigger=0x0094000000000007)
Loading
Loading