Skip to content

Commit b633791

Browse files
Merge pull request #39 from endor-force/location-for-camera
Add location to filter for camera
2 parents 326816a + 62fd469 commit b633791

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pytrafikverket/trafikverket_camera.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
FieldFilter,
1010
FilterOperation,
1111
NodeHelper,
12+
OrFilter,
1213
Trafikverket,
1314
)
1415

@@ -112,7 +113,14 @@ async def async_get_camera(self, location_name: str) -> CameraInfo:
112113
"Camera",
113114
"1.0",
114115
CAMERA_INFO_REQUIRED_FIELDS,
115-
[FieldFilter(FilterOperation.EQUAL, "Name", location_name)],
116+
[
117+
OrFilter(
118+
[
119+
FieldFilter(FilterOperation.LIKE, "Name", location_name),
120+
FieldFilter(FilterOperation.LIKE, "Location", location_name),
121+
]
122+
)
123+
],
116124
)
117125
if len(cameras) == 0:
118126
raise NoCameraFound("Could not find a camera with the specified name")

0 commit comments

Comments
 (0)