generated from ludeeus/integration_blueprint
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
default_config: | ||
|
||
irrigation_unlimited: | ||
refresh_interval: 2000 | ||
testing: | ||
enabled: true | ||
speed: 1.0 | ||
output_events: false | ||
show_log: false | ||
autoplay: false | ||
times: | ||
- name: "1-Sequence 1" | ||
start: "2023-10-24 06:00" | ||
end: "2023-10-24 07:00" | ||
results: | ||
- {t: '2023-10-24 06:05', c: 1, z: 0, s: 1} | ||
- {t: '2023-10-24 06:05', c: 1, z: 1, s: 1} | ||
- {t: '2023-10-24 06:11', c: 1, z: 1, s: 0} | ||
- {t: '2023-10-24 06:11', c: 1, z: 0, s: 0} | ||
- {t: '2023-10-24 06:12', c: 1, z: 0, s: 1} | ||
- {t: '2023-10-24 06:12', c: 1, z: 2, s: 1} | ||
- {t: '2023-10-24 06:24', c: 1, z: 2, s: 0} | ||
- {t: '2023-10-24 06:24', c: 1, z: 0, s: 0} | ||
controllers: | ||
- name: "Test controller 1" | ||
user: | ||
area: My Farm | ||
picture: /my_pic.jpg | ||
all_zones_config: | ||
user: | ||
actuator: KNX 6.1 | ||
zones: | ||
- name: "Zone 1" | ||
user: | ||
area: Eastern Pastures | ||
flow_rate_gallon_per_minute: 25 | ||
picture: /my_pic.jpg | ||
gps: 42.746635,-75.770045 | ||
- name: "Zone 2" | ||
sequences: | ||
- name: "Sequence 1" | ||
delay: "0:01:00" | ||
schedules: | ||
- time: "06:05" | ||
zones: | ||
- zone_id: 1 | ||
duration: "0:06:00" | ||
- zone_id: 2 | ||
duration: "0:12:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""irrigation_unlimited user data test""" | ||
import homeassistant.core as ha | ||
from tests.iu_test_support import IUExam | ||
|
||
IUExam.quiet_mode() | ||
|
||
|
||
async def test_user(hass: ha.HomeAssistant, skip_dependencies, skip_history): | ||
"""Test IUUser class.""" | ||
# pylint: disable=unused-argument | ||
|
||
# Start an examination | ||
async with IUExam(hass, "test_user.yaml") as exam: | ||
await exam.begin_test(1) | ||
attr = hass.states.get("binary_sensor.irrigation_unlimited_c1_m").attributes | ||
assert attr["user_area"] == "My Farm" | ||
assert attr["user_picture"] == "/my_pic.jpg" | ||
attr = hass.states.get("binary_sensor.irrigation_unlimited_c1_z1").attributes | ||
assert attr["user_area"] == "Eastern Pastures" | ||
assert attr["user_actuator"] == "KNX 6.1" | ||
assert attr["user_flow_rate_gallon_per_minute"] == 25 | ||
assert attr["user_picture"] == "/my_pic.jpg" | ||
assert attr["user_gps"] == "42.746635,-75.770045" | ||
await exam.finish_test() | ||
|
||
exam.check_summary() |