From dbd21eb6fabd3c6f9411d5a22be45e3d63a8f117 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:30:23 -0500 Subject: [PATCH 01/18] use getattr instead of get (#8094) --- frigate/ptz/onvif.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/ptz/onvif.py b/frigate/ptz/onvif.py index 7ab13b9e9..0315446e9 100644 --- a/frigate/ptz/onvif.py +++ b/frigate/ptz/onvif.py @@ -176,7 +176,7 @@ class OnvifController: for preset in presets: self.cams[camera_name]["presets"][ - preset.get("Name", f"preset {preset['token']}").lower() + getattr(preset, "Name", f"preset {preset['token']}").lower() ] = preset["token"] # get list of supported features From cc6e049966a569692734e3301f0cefb4fcb8cae7 Mon Sep 17 00:00:00 2001 From: Daniel <47092714+Daniel-dev22@users.noreply.github.com> Date: Sun, 8 Oct 2023 15:30:53 -0400 Subject: [PATCH 02/18] Change multiselect camera icon (#8016) * CenterFocusString icon * Add CenterFocusString to multiselect * Rename CenterFocusString.jsx * Rename icon and make it smaller * Rename icon * Fix lint and use icon for speech * remove unused vars * Remove unused import --- web/src/components/MultiSelect.jsx | 7 ++----- web/src/icons/SelectOnly.jsx | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 web/src/icons/SelectOnly.jsx diff --git a/web/src/components/MultiSelect.jsx b/web/src/components/MultiSelect.jsx index b2b3ab053..5c706fd24 100644 --- a/web/src/components/MultiSelect.jsx +++ b/web/src/components/MultiSelect.jsx @@ -4,9 +4,7 @@ import Menu from './Menu'; import { ArrowDropdown } from '../icons/ArrowDropdown'; import Heading from './Heading'; import Button from './Button'; -import CameraIcon from '../icons/Camera'; -import SpeakerIcon from '../icons/Speaker'; -import useSWR from 'swr'; +import SelectOnlyIcon from '../icons/SelectOnly'; export default function MultiSelect({ className, title, options, selection, onToggle, onShowAll, onSelectSingle }) { const popupRef = useRef(null); @@ -20,7 +18,6 @@ export default function MultiSelect({ className, title, options, selection, onTo }; const menuHeight = Math.round(window.innerHeight * 0.55); - const { data: config } = useSWR('config'); return (
setState({ showMenu: true })}> @@ -61,7 +58,7 @@ export default function MultiSelect({ className, title, options, selection, onTo className="max-h-[35px] mx-2" onClick={() => onSelectSingle(item)} > - {title === 'Labels' && config.audio.listen.includes(item) ? : } + { ( ) }
diff --git a/web/src/icons/SelectOnly.jsx b/web/src/icons/SelectOnly.jsx new file mode 100644 index 000000000..f0aca6bd8 --- /dev/null +++ b/web/src/icons/SelectOnly.jsx @@ -0,0 +1,21 @@ +import { h } from 'preact'; +import { memo } from 'preact/compat'; + +export function SelectOnly({ className = 'h-5 w-5', stroke = 'currentColor', fill = 'none', onClick = () => {} }) { + return ( + + + + ); +} + +export default memo(SelectOnly); From d7ddcea951d69267774fd7788f08ac53e4d943f9 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sun, 8 Oct 2023 13:49:41 -0600 Subject: [PATCH 03/18] Show settings cog for camera toggles on mobile (#8098) * Show settings cog on mobile * Cleanup ui and remove label * Fix tests --- web/src/components/Switch.jsx | 4 +- web/src/routes/Cameras.jsx | 105 +++++++++++++++++--- web/src/routes/__tests__/Cameras.test.jsx | 2 + web/src/routes/__tests__/Recording.test.jsx | 2 + 4 files changed, 96 insertions(+), 17 deletions(-) diff --git a/web/src/components/Switch.jsx b/web/src/components/Switch.jsx index eaf42690d..db040f4a5 100644 --- a/web/src/components/Switch.jsx +++ b/web/src/components/Switch.jsx @@ -1,7 +1,7 @@ import { h } from 'preact'; import { useCallback, useState } from 'preact/hooks'; -export default function Switch({ checked, id, onChange, label, labelPosition = 'before' }) { +export default function Switch({ className, checked, id, onChange, label, labelPosition = 'before' }) { const [isFocused, setFocused] = useState(false); const handleChange = useCallback(() => { @@ -21,7 +21,7 @@ export default function Switch({ checked, id, onChange, label, labelPosition = ' return (