Skip to content

Commit

Permalink
Fix day/night mode switch (#370)
Browse files Browse the repository at this point in the history
* Fix python check for day/night mode

* don't redo formatting
  • Loading branch information
hawkeye217 authored Jul 8, 2024
1 parent 07deed0 commit 8cffd43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/dahua/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ async def async_set_video_profile_mode(self, mode: str):
channel = self._coordinator.get_channel()
model = self._coordinator.get_model()
# Some NVRs like the Lorex DHI-NVR4108HS-8P-4KS2 change the day/night mode through a switch
if 'NVR4108HS' or 'IPC-Color4K' in model:
if any(substring in model for substring in ['NVR4108HS', 'IPC-Color4K']):
await self._coordinator.client.async_set_night_switch_mode(channel, mode)
else:
await self._coordinator.client.async_set_video_profile_mode(channel, mode)
Expand Down

0 comments on commit 8cffd43

Please sign in to comment.