Implement Flush Mounted Presence Sensor Routine Control and change the device type logic

This commit is contained in:
mohammad
2025-05-11 16:33:11 +03:00
parent 2651de71e4
commit adb42f95e8
26 changed files with 1071 additions and 180 deletions

View File

@ -0,0 +1,18 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.8326 16.8575C7.55614 16.8575 4.89062 14.192 4.89062 10.9156C4.89062 7.63915 7.55614 4.97363 10.8326 4.97363C14.1091 4.97363 16.7746 7.63915 16.7746 10.9156C16.7746 14.192 14.1091 16.8575 10.8326 16.8575Z" fill="#FFE645"/>
<path d="M10.8333 4.97363C10.8332 4.97363 10.833 4.97363 10.833 4.97363V16.8575H10.8333C14.1098 16.8575 16.7753 14.192 16.7753 10.9156C16.7753 7.63915 14.1098 4.97363 10.8333 4.97363Z" fill="#FFF1B9"/>
<path d="M10.833 21.8334C10.4824 21.8334 10.1982 21.5493 10.1982 21.1986V18.8289C10.1982 18.4784 10.4824 18.1941 10.833 18.1941C11.1836 18.1941 11.4678 18.4784 11.4678 18.8289V21.1986C11.4678 21.5493 11.1836 21.8334 10.833 21.8334Z" fill="#FFE645"/>
<path d="M21.0317 11.6348H18.7461C18.3955 11.6348 18.1113 11.3506 18.1113 11C18.1113 10.6496 18.3955 10.3652 18.7461 10.3652H21.0317C21.3824 10.3652 21.6665 10.6496 21.6665 11C21.6665 11.3506 21.3824 11.6348 21.0317 11.6348Z" fill="#FFCF2C"/>
<path d="M2.92042 11.6348H0.634766C0.284157 11.6348 0 11.3506 0 11C0 10.6496 0.284157 10.3652 0.634766 10.3652H2.92042C3.27103 10.3652 3.55518 10.6496 3.55518 11C3.55518 11.3506 3.27103 11.6348 2.92042 11.6348Z" fill="#FFE645"/>
<path d="M17.7243 7.65695C17.5049 7.65695 17.2915 7.54306 17.174 7.33941C16.9988 7.03591 17.1027 6.64761 17.4064 6.47239L19.3481 5.3513C19.6517 5.17591 20.04 5.28005 20.2152 5.58372C20.3905 5.88721 20.2865 6.27551 19.9828 6.45073L18.0412 7.57182C17.9412 7.62951 17.8321 7.65695 17.7243 7.65695Z" fill="#FFCF2C"/>
<path d="M2.03686 16.7139C1.8175 16.7139 1.60409 16.6 1.48656 16.3963C1.31117 16.0928 1.41531 15.7045 1.71881 15.5293L3.69865 14.3862C4.00231 14.2108 4.39045 14.315 4.56567 14.6186C4.74106 14.9221 4.63708 15.3104 4.33342 15.4856L2.35358 16.6287C2.25373 16.6864 2.14447 16.7139 2.03686 16.7139Z" fill="#FFE645"/>
<path d="M5.76902 20.4051C5.6614 20.4051 5.5523 20.3778 5.4523 20.32C5.14863 20.1448 5.04466 19.7565 5.21988 19.453L6.36279 17.4735C6.53801 17.17 6.92631 17.0658 7.22981 17.2412C7.53347 17.4164 7.63744 17.8047 7.46222 18.1082L6.31931 20.0877C6.20178 20.2914 5.98838 20.4051 5.76902 20.4051Z" fill="#FFE645"/>
<path d="M3.94197 7.65681C3.83419 7.65681 3.72509 7.62937 3.62524 7.57168L1.64557 6.42877C1.34207 6.25355 1.23793 5.86525 1.41332 5.56158C1.58854 5.25809 1.97667 5.15395 2.28033 5.32933L4.26001 6.47224C4.56351 6.64746 4.66748 7.03576 4.49226 7.33926C4.37473 7.54291 4.16132 7.65681 3.94197 7.65681Z" fill="#FFE645"/>
<path d="M19.6649 16.7342C19.5572 16.7342 19.4481 16.7067 19.348 16.6491L17.333 15.4857C17.0295 15.3103 16.9255 14.9221 17.1007 14.6185C17.276 14.315 17.6643 14.2108 17.9678 14.3862L19.9828 15.5496C20.2865 15.7248 20.3905 16.1131 20.2152 16.4166C20.0977 16.6203 19.8843 16.7342 19.6649 16.7342Z" fill="#FFCF2C"/>
<path d="M15.8973 20.4051C15.6778 20.4051 15.4645 20.2913 15.347 20.0877L14.2043 18.1085C14.029 17.8048 14.133 17.4167 14.4367 17.2415C14.7402 17.0661 15.1285 17.1701 15.3037 17.4737L16.4464 19.4529C16.6217 19.7566 16.5177 20.1447 16.214 20.3199C16.114 20.3778 16.0049 20.4051 15.8973 20.4051Z" fill="#FFCF2C"/>
<path d="M10.833 3.72144C10.4824 3.72144 10.1982 3.43728 10.1982 3.08667V0.801514C10.1982 0.450905 10.4824 0.166748 10.833 0.166748C11.1836 0.166748 11.4678 0.450905 11.4678 0.801514V3.08667C11.4678 3.43728 11.1836 3.72144 10.833 3.72144Z" fill="#FFE645"/>
<path d="M14.7534 4.75952C14.6458 4.75952 14.5365 4.73208 14.4367 4.67422C14.133 4.499 14.029 4.11086 14.2043 3.8072L15.3472 1.82786C15.5224 1.5242 15.9105 1.42005 16.2142 1.59544C16.5178 1.77066 16.6218 2.15896 16.4466 2.46262L15.3037 4.44197C15.1862 4.64562 14.9728 4.75952 14.7534 4.75952Z" fill="#FFCF2C"/>
<path d="M6.91292 4.75919C6.69356 4.75919 6.48015 4.64529 6.36262 4.44164L5.21988 2.46262C5.04466 2.15896 5.14863 1.77066 5.4523 1.59544C5.75579 1.42005 6.14409 1.5242 6.31931 1.82786L7.46206 3.80687C7.63728 4.11053 7.5333 4.49867 7.22964 4.67405C7.1298 4.73175 7.02053 4.75919 6.91292 4.75919Z" fill="#FFE645"/>
<path d="M10.8333 18.1941C10.8332 18.1941 10.833 18.1941 10.833 18.1941V21.8334H10.8333C11.1839 21.8334 11.4681 21.5493 11.4681 21.1986V18.8289C11.4681 18.4784 11.1839 18.1941 10.8333 18.1941Z" fill="#FFCF2C"/>
<path d="M10.8333 0.166748C10.8332 0.166748 10.833 0.166748 10.833 0.166748V3.72144H10.8333C11.1839 3.72144 11.4681 3.43728 11.4681 3.08667V0.801514C11.4681 0.450905 11.1839 0.166748 10.8333 0.166748Z" fill="#FFCF2C"/>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,17 @@
<svg width="22" height="14" viewBox="0 0 22 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.6663 11.1257L7.02441 8.58667L10.833 13.6648H21.6663V11.1257Z" fill="#FFB54C"/>
<path d="M0 11.1257V13.6648H10.8333V8.58667L0 11.1257Z" fill="#FFCC4A"/>
<path d="M21.6663 11.1257V5.41284H20.0688L19.4341 6.04761L18.7993 5.41284H17.2018L16.5671 6.04761L15.9323 5.41284H14.3348L13.7 6.04761L13.0653 5.41284H11.4678L8.29395 8.26929L10.833 11.1257H21.6663Z" fill="#FFCC4A"/>
<path d="M10.8333 5.41284H10.1986H8.60107L7.96631 6.04761L7.33154 5.41284H5.73405L5.09928 6.04761L4.46452 5.41284H2.86702L2.23226 6.04761L1.59749 5.41284H0V11.1257H10.8333V5.41284Z" fill="#FFE278"/>
<path d="M21.0316 1.60449H10.833L10.1982 2.23926L10.833 2.87402H21.0316V1.60449Z" fill="#ABD5ED"/>
<path d="M10.8333 1.60449H1.26953V0.334961H0V4.14355H1.26953V2.87402H10.8333V1.60449Z" fill="#BFEBFF"/>
<path d="M20.3965 0.334961H21.666V4.14355H20.3965V0.334961Z" fill="#ABD5ED"/>
<path d="M1.59766 5.41284H2.86719V8.58667H1.59766V5.41284Z" fill="#587AA1"/>
<path d="M4.46484 5.41284H5.73438V7.31714H4.46484V5.41284Z" fill="#587AA1"/>
<path d="M7.33203 5.41284H8.60156V8.58667H7.33203V5.41284Z" fill="#587AA1"/>
<path d="M11.4678 7.31714H10.833L10.5156 6.99976V5.73022L10.833 5.41284H11.4678V7.31714Z" fill="#455F80"/>
<path d="M10.1982 5.41284H10.833V7.31714H10.1982V5.41284Z" fill="#587AA1"/>
<path d="M13.0654 5.41284H14.335V8.58667H13.0654V5.41284Z" fill="#455F80"/>
<path d="M15.9326 5.41284H17.2021V7.31714H15.9326V5.41284Z" fill="#455F80"/>
<path d="M18.7998 5.41284H20.0693V8.58667H18.7998V5.41284Z" fill="#455F80"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,17 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_8194_10048)">
<path d="M11.4732 16.7316C8.31096 16.7316 5.73828 14.1589 5.73828 10.9967C5.73828 7.8344 8.31096 5.26172 11.4732 5.26172C14.6355 5.26172 17.2081 7.8344 17.2081 10.9967C17.2081 14.1589 14.6355 16.7316 11.4732 16.7316Z" fill="#EBF6FF"/>
<path d="M17.2076 10.9967C17.2076 7.8344 14.6349 5.26172 11.4727 5.26172V16.7316C14.6349 16.7316 17.2076 14.1589 17.2076 10.9967Z" fill="#D7E7F8"/>
<path d="M11.4721 17.3699C7.95827 17.3699 5.09961 14.5112 5.09961 10.9974C5.09961 7.48362 7.95827 4.625 11.472 4.625C14.9858 4.625 17.8445 7.48366 17.8445 10.9974C17.8445 14.5112 14.9858 17.3699 11.4721 17.3699ZM11.4721 5.89473C8.6584 5.89473 6.36934 8.18379 6.36934 10.9974C6.36934 13.811 8.6584 16.1001 11.472 16.1001C14.2857 16.1001 16.5748 13.8111 16.5748 10.9974C16.5748 8.18375 14.2857 5.89473 11.4721 5.89473Z" fill="#9FE066"/>
<path d="M11.4728 11.6318H8.28525C7.93464 11.6318 7.65039 11.3475 7.65039 10.9969C7.65039 10.6463 7.93464 10.3621 8.28525 10.3621H10.8379V8.95127C10.8379 8.60066 11.1222 8.31641 11.4728 8.31641C11.8234 8.31641 12.1076 8.60066 12.1076 8.95127V10.9969C12.1077 11.3475 11.8234 11.6318 11.4728 11.6318Z" fill="#394949"/>
<path d="M12.1075 10.9969V8.95127C12.1075 8.60066 11.8233 8.31641 11.4727 8.31641V11.6318C11.8233 11.6318 12.1075 11.3475 12.1075 10.9969Z" fill="#151F1F"/>
<path d="M16.5753 10.9974C16.5753 13.8111 14.2863 16.1001 11.4727 16.1001V17.3698C14.9865 17.3698 17.8451 14.5112 17.8451 10.9974C17.8451 7.48366 14.9864 4.625 11.4727 4.625V5.89473C14.2863 5.89473 16.5753 8.18379 16.5753 10.9974Z" fill="#4ACA7B"/>
<path d="M18.6832 3.78752C16.7572 1.86147 14.1963 0.800781 11.4725 0.800781C8.74869 0.800781 6.18782 1.86147 4.26177 3.78752C2.67775 5.37158 1.67966 7.38516 1.37492 9.56545L1.08378 9.2743C0.835882 9.02641 0.433887 9.02641 0.185951 9.2743C-0.0619838 9.52219 -0.0619838 9.92419 0.185951 10.1721L1.46097 11.4471C1.58494 11.5711 1.74742 11.6331 1.90986 11.6331C2.0723 11.6331 2.23482 11.5711 2.35875 11.4471L3.63377 10.1721C3.8817 9.92423 3.8817 9.52224 3.63377 9.2743C3.38587 9.02641 2.98388 9.02641 2.73594 9.2743L2.70678 9.30346C3.50083 5.18845 7.12907 2.07051 11.4725 2.07051C16.3953 2.07051 20.4003 6.07548 20.4003 10.9983C20.4003 15.921 16.3953 19.926 11.4725 19.926C7.46868 19.926 3.9294 17.234 2.86558 13.3794C2.77234 13.0413 2.42266 12.8429 2.08474 12.9363C1.74674 13.0295 1.54837 13.3792 1.64165 13.7171C2.22378 15.8264 3.50315 17.7286 5.24408 19.0732C7.04184 20.4618 9.19555 21.1957 11.4725 21.1957C14.1963 21.1957 16.7571 20.135 18.6832 18.209C20.6093 16.2829 21.67 13.7221 21.67 10.9983C21.67 8.27439 20.6093 5.71361 18.6832 3.78752Z" fill="#FF4D5B"/>
<path d="M20.4004 10.9983C20.4004 15.9211 16.3955 19.926 11.4727 19.926V21.1958C14.1965 21.1958 16.7573 20.135 18.6834 18.209C20.6095 16.2829 21.6702 13.7221 21.6702 10.9983C21.6702 8.27439 20.6094 5.71361 18.6834 3.78752C16.7573 1.86147 14.1965 0.800781 11.4727 0.800781V2.07051C16.3955 2.07051 20.4004 6.07548 20.4004 10.9983Z" fill="#DE0062"/>
</g>
<defs>
<clipPath id="clip0_8194_10048">
<rect width="21.67" height="21.67" fill="white" transform="translate(0 0.164062)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,17 @@
<svg width="22" height="14" viewBox="0 0 22 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.6663 11.1257L7.02441 8.58667L10.833 13.6648H21.6663V11.1257Z" fill="#FFB54C"/>
<path d="M0 11.1257V13.6648H10.8333V8.58667L0 11.1257Z" fill="#FFCC4A"/>
<path d="M21.6663 11.1257V5.41284H20.0688L19.4341 6.04761L18.7993 5.41284H17.2018L16.5671 6.04761L15.9323 5.41284H14.3348L13.7 6.04761L13.0653 5.41284H11.4678L8.29395 8.26929L10.833 11.1257H21.6663Z" fill="#FFCC4A"/>
<path d="M10.8333 5.41284H10.1986H8.60107L7.96631 6.04761L7.33154 5.41284H5.73405L5.09928 6.04761L4.46452 5.41284H2.86702L2.23226 6.04761L1.59749 5.41284H0V11.1257H10.8333V5.41284Z" fill="#FFE278"/>
<path d="M21.0316 1.60449H10.833L10.1982 2.23926L10.833 2.87402H21.0316V1.60449Z" fill="#ABD5ED"/>
<path d="M10.8333 1.60449H1.26953V0.334961H0V4.14355H1.26953V2.87402H10.8333V1.60449Z" fill="#BFEBFF"/>
<path d="M20.3965 0.334961H21.666V4.14355H20.3965V0.334961Z" fill="#ABD5ED"/>
<path d="M1.59766 5.41284H2.86719V8.58667H1.59766V5.41284Z" fill="#587AA1"/>
<path d="M4.46484 5.41284H5.73438V7.31714H4.46484V5.41284Z" fill="#587AA1"/>
<path d="M7.33203 5.41284H8.60156V8.58667H7.33203V5.41284Z" fill="#587AA1"/>
<path d="M11.4678 7.31714H10.833L10.5156 6.99976V5.73022L10.833 5.41284H11.4678V7.31714Z" fill="#455F80"/>
<path d="M10.1982 5.41284H10.833V7.31714H10.1982V5.41284Z" fill="#587AA1"/>
<path d="M13.0654 5.41284H14.335V8.58667H13.0654V5.41284Z" fill="#455F80"/>
<path d="M15.9326 5.41284H17.2021V7.31714H15.9326V5.41284Z" fill="#455F80"/>
<path d="M18.7998 5.41284H20.0693V8.58667H18.7998V5.41284Z" fill="#455F80"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,23 @@
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_8194_10077)">
<path d="M17.6 18.673C17.3521 18.4251 17.3521 18.0231 17.6 17.7752C19.4054 15.9698 20.3996 13.5678 20.3996 11.0115C20.3996 8.45525 19.4054 6.05318 17.6 4.24784C17.3521 3.99994 17.3521 3.59795 17.6 3.35001C17.8479 3.10208 18.2499 3.10208 18.4978 3.35001C20.543 5.39516 21.6694 8.11606 21.6694 11.0115C21.6694 13.9069 20.543 16.6278 18.4978 18.673C18.2503 18.9205 17.8484 18.9213 17.6 18.673Z" fill="#7AFFE4"/>
<path d="M15.6781 16.7502C15.4302 16.5023 15.4302 16.1003 15.6781 15.8524C16.9704 14.5602 17.6821 12.8408 17.6821 11.011C17.6821 9.18128 16.9705 7.46194 15.6781 6.1697C15.4302 5.92176 15.4302 5.51981 15.6781 5.27187C15.926 5.02398 16.328 5.02394 16.576 5.27187C18.1081 6.80393 18.9519 8.84213 18.9519 11.0111C18.9519 13.18 18.1081 15.2182 16.576 16.7503C16.3279 16.9982 15.926 16.9981 15.6781 16.7502Z" fill="#00DDC1"/>
<path d="M13.7543 14.8285C13.5064 14.5805 13.5064 14.1785 13.7543 13.9306C14.5331 13.152 14.9619 12.1158 14.9619 11.0131C14.9619 9.91034 14.5331 8.87416 13.7543 8.09548C13.5064 7.84758 13.5064 7.44559 13.7543 7.19765C14.0022 6.94976 14.4042 6.94972 14.6521 7.19765C15.6707 8.21619 16.2317 9.5712 16.2317 11.0131C16.2317 12.455 15.6707 13.81 14.6521 14.8285C14.4042 15.0764 14.0022 15.0763 13.7543 14.8285Z" fill="#7AFFE4"/>
<path d="M17.6 18.6732C17.8484 18.9216 18.2503 18.9207 18.4978 18.6732C20.543 16.6281 21.6694 13.9072 21.6694 11.0117H20.3996C20.3996 13.568 19.4054 15.97 17.6 17.7754C17.3521 18.0233 17.3521 18.4253 17.6 18.6732Z" fill="#00DDC1"/>
<path d="M15.6781 16.7509C15.926 16.9988 16.3279 16.9989 16.5759 16.7509C18.1081 15.2189 18.9518 13.1807 18.9518 11.0117H17.6821C17.6821 12.8415 16.9704 14.5608 15.6781 15.8531C15.4302 16.101 15.4302 16.503 15.6781 16.7509Z" fill="#00B4BC"/>
<path d="M13.7543 14.8272C14.0022 15.0751 14.4041 15.0751 14.6521 14.8272C15.6707 13.8086 16.2316 12.4536 16.2316 11.0117H14.9619C14.9619 12.1144 14.533 13.1506 13.7543 13.9293C13.5064 14.1772 13.5064 14.5792 13.7543 14.8272Z" fill="#00DDC1"/>
<path d="M3.17152 18.673C1.12633 16.6278 0 13.9069 0 11.0115C0 8.11604 1.12633 5.39515 3.17152 3.35C3.41946 3.10206 3.82141 3.10211 4.06935 3.35C4.31728 3.59793 4.31728 3.99989 4.06935 4.24782C2.26396 6.05316 1.26973 8.45523 1.26973 11.0115C1.26973 13.5677 2.26396 15.9698 4.06935 17.7751C4.31728 18.023 4.31728 18.425 4.06935 18.673C3.82141 18.921 3.41937 18.9209 3.17152 18.673Z" fill="#7AFFE4"/>
<path d="M5.09462 16.7503C3.56253 15.2182 2.71875 13.18 2.71875 11.0111C2.71875 8.84212 3.56253 6.80391 5.09466 5.27186C5.3426 5.02396 5.74459 5.02396 5.99249 5.27186C6.24038 5.51979 6.24038 5.92175 5.99249 6.16968C4.70016 7.46197 3.98848 9.1813 3.98848 11.0111C3.98848 12.8408 4.70016 14.5602 5.99249 15.8524C6.24042 16.1003 6.24042 16.5023 5.99249 16.7502C5.74489 16.9978 5.34294 16.9985 5.09462 16.7503Z" fill="#00DDC1"/>
<path d="M7.01704 14.8285C5.99847 13.81 5.4375 12.455 5.4375 11.0131C5.4375 9.5712 5.99847 8.21619 7.01704 7.19765C7.26498 6.94972 7.66697 6.94976 7.91486 7.19765C8.1628 7.44559 8.16276 7.84758 7.91486 8.09548C7.1361 8.87416 6.70723 9.91034 6.70723 11.0131C6.70723 12.1158 7.1361 13.152 7.91486 13.9306C8.1628 14.1785 8.1628 14.5805 7.91486 14.8285C7.66727 15.0761 7.26531 15.0768 7.01704 14.8285Z" fill="#7AFFE4"/>
<path d="M4.06935 18.6732C4.31728 18.4253 4.31728 18.0233 4.06935 17.7754C2.26396 15.97 1.26973 13.568 1.26973 11.0117H0C0 13.9072 1.12633 16.6281 3.17152 18.6732C3.41937 18.9211 3.82141 18.9212 4.06935 18.6732Z" fill="#00DDC1"/>
<path d="M5.99249 16.7509C6.24038 16.5029 6.24038 16.101 5.99249 15.8531C4.70016 14.5609 3.98848 12.8415 3.98848 11.0117H2.71875C2.71875 13.1807 3.56253 15.2189 5.09466 16.7509C5.34294 16.9992 5.74489 16.9985 5.99249 16.7509Z" fill="#00B4BC"/>
<path d="M7.91486 14.8271C8.1628 14.5792 8.16276 14.1772 7.91486 13.9293C7.1361 13.1506 6.70723 12.1144 6.70723 11.0117H5.4375C5.4375 12.4536 5.99846 13.8086 7.01704 14.8272C7.26527 15.0754 7.66722 15.0747 7.91486 14.8271Z" fill="#00DDC1"/>
<path d="M10.835 13.6857C12.3123 13.6857 13.5099 12.4881 13.5099 11.0108C13.5099 9.53353 12.3123 8.33594 10.835 8.33594C9.35775 8.33594 8.16016 9.53353 8.16016 11.0108C8.16016 12.4881 9.35775 13.6857 10.835 13.6857Z" fill="#00DDC1"/>
<path d="M10.835 13.6866C12.31 13.6866 13.5099 12.4866 13.5099 11.0117H8.16016C8.16016 12.4867 9.36009 13.6866 10.835 13.6866Z" fill="#00B4BC"/>
</g>
<defs>
<clipPath id="clip0_8194_10077">
<rect width="21.67" height="21.67" fill="white" transform="translate(0 0.164062)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,4 @@
<svg width="23" height="22" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20.0539 4.23654C21.4826 6.07144 22.3331 8.37817 22.3331 10.8834C22.3331 16.8663 17.4827 21.7167 11.4998 21.7167L10.2744 20.2302L11.4998 18.829C15.8882 18.829 19.4454 15.2717 19.4454 10.8834C19.4454 9.17629 18.9075 7.59487 17.9909 6.29953L11.4998 12.7906L10.5337 11.1112L11.4998 8.97612L16.0837 4.39227C14.7883 3.47567 13.2069 2.93781 11.4998 2.93781L10.2744 1.33418L11.4998 0.0500488C14.005 0.0500488 16.3118 0.900635 18.1467 2.32928L20.4115 0.0500488L22.3331 1.94165L20.0539 4.23654Z" fill="#66B3FF"/>
<path d="M3.55475 10.8834C3.55475 12.5905 4.09261 14.1719 5.00921 15.4672L11.5003 8.97612V12.7906L6.91647 17.3745C8.21182 18.2911 9.79323 18.829 11.5003 18.829V21.7167C8.99512 21.7167 6.68838 20.8661 4.85348 19.4375L2.57214 21.7167L0.666992 19.8116L2.94622 17.5302C1.51758 15.6953 0.666992 13.3886 0.666992 10.8834C0.666992 4.9005 5.51745 0.0500488 11.5003 0.0500488V2.93781C7.11198 2.93781 3.55475 6.49504 3.55475 10.8834Z" fill="#80D4FF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,18 @@
<svg width="23" height="20" viewBox="0 0 23 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.5833 1.84497L1.22267 16.046C0.0476544 17.6566 1.198 19.9198 3.19166 19.9198H19.975C21.9687 19.9198 23.119 17.6566 21.944 16.046L11.5833 1.84497Z" fill="#F1FAFF"/>
<path d="M21.9431 16.0448L11.5833 1.84497L9.81055 4.27486L18.3975 16.0448C19.5729 17.6558 18.4222 19.9198 16.4279 19.9198H19.9735C21.9678 19.9198 23.1185 17.6559 21.9431 16.0448Z" fill="#C7EEFB"/>
<path d="M13.6602 6.1864H9.51926C8.38838 6.1864 7.47168 5.26966 7.47168 4.13882V2.24846C7.47168 2.13162 7.56643 2.03687 7.68327 2.03687H15.4963C15.6131 2.03687 15.7079 2.13162 15.7079 2.24846V4.13882C15.7079 5.26966 14.7911 6.1864 13.6602 6.1864Z" fill="#E0DDE2"/>
<path d="M15.498 2.03687H14.3393V2.76335C14.3393 3.89681 13.4204 4.81567 12.287 4.81567H8.15546C7.94886 4.81567 7.74959 4.78482 7.56152 4.72807C7.81628 5.57186 8.59934 6.18645 9.52624 6.18645H13.6578C14.7912 6.18645 15.7101 5.26759 15.7101 4.13413V2.24892C15.7101 2.13183 15.6151 2.03687 15.498 2.03687Z" fill="#C8C1C9"/>
<path d="M17.0524 2.78679H6.12858C6.01174 2.78679 5.91699 2.69204 5.91699 2.5752V0.544844C5.91699 0.428003 6.01174 0.333252 6.12858 0.333252H17.0524C17.1692 0.333252 17.264 0.428003 17.264 0.544844V2.5752C17.264 2.69208 17.1693 2.78679 17.0524 2.78679Z" fill="#E0DDE2"/>
<path d="M17.0519 0.333252H15.8129V1.12359C15.8129 1.24073 15.7179 1.33569 15.6008 1.33569H5.91699V2.57473C5.91699 2.69187 6.01195 2.78684 6.12909 2.78684H17.0519C17.1691 2.78684 17.264 2.69187 17.264 2.57473V0.545352C17.264 0.428215 17.1691 0.333252 17.0519 0.333252Z" fill="#C8C1C9"/>
<path d="M11.591 4.95259C11.891 4.95259 12.1342 4.7094 12.1342 4.4094C12.1342 4.10941 11.891 3.86621 11.591 3.86621C11.291 3.86621 11.0479 4.10941 11.0479 4.4094C11.0479 4.7094 11.291 4.95259 11.591 4.95259Z" fill="#FA2A3B"/>
<path d="M11.4636 10.3904C12.0045 10.3904 12.4429 9.95199 12.4429 9.41116C12.4429 8.87032 12.0045 8.43188 11.4636 8.43188C10.9228 8.43188 10.4844 8.87032 10.4844 9.41116C10.4844 9.95199 10.9228 10.3904 11.4636 10.3904Z" fill="#62D8F9"/>
<path d="M11.4638 8.43213C11.3942 8.43213 11.3262 8.43953 11.2607 8.45333C11.7041 8.54685 12.0369 8.94019 12.0369 9.4114C12.0369 9.88261 11.7041 10.276 11.2607 10.3695C11.3263 10.3833 11.3942 10.3907 11.4638 10.3907C12.0046 10.3907 12.4431 9.95222 12.4431 9.4114C12.4431 8.87058 12.0047 8.43213 11.4638 8.43213Z" fill="#00BEF7"/>
<path d="M14.8717 13.5145L13.1586 13.236L12.2278 11.4381C12.1444 11.2501 12.0134 10.9926 11.7241 10.9064L10.637 10.5802C10.5178 10.5512 10.4031 10.5405 10.1997 10.5725L7.88145 11.1109C7.74264 11.1432 7.61865 11.2211 7.5294 11.3322L6.29163 12.8728C6.07157 13.1467 6.1152 13.5471 6.38913 13.7672C6.50661 13.8617 6.64736 13.9075 6.78718 13.9075C6.97338 13.9075 7.15789 13.8262 7.28357 13.6697L8.3836 12.3006L9.47165 12.0479L8.83273 14.1772C8.82045 14.213 8.81652 14.2593 8.79896 14.3605L8.43849 16.9193L6.75734 18.3779C6.49192 18.6082 6.46344 19.0101 6.69374 19.2755C6.81959 19.4205 6.99657 19.4948 7.1746 19.4948C7.32238 19.4948 7.47087 19.4435 7.59127 19.3391L9.45227 17.7244C9.56826 17.6238 9.64393 17.4847 9.66534 17.3326L9.96009 15.2404L9.99932 15.2522L11.5919 17.1109L12.5347 19.1578C12.642 19.3907 12.8723 19.528 13.113 19.528C13.202 19.528 13.2925 19.5092 13.3787 19.4695C13.6979 19.3225 13.8374 18.9446 13.6905 18.6254L12.7106 16.4981C12.686 16.4446 12.6542 16.3949 12.6159 16.3503L11.2825 14.7941L11.7411 13.2658L12.1757 14.1053C12.2683 14.2841 12.44 14.4085 12.6386 14.4408L14.6674 14.7706C14.702 14.7762 14.7364 14.7789 14.7703 14.7789C15.0767 14.7789 15.3468 14.5569 15.3975 14.2447C15.4539 13.8978 15.2185 13.5709 14.8717 13.5145Z" fill="#62D8F9"/>
<path d="M9.74707 10.6776C9.95045 10.6457 10.0645 10.6586 10.1838 10.6876L11.2709 11.0138C11.5602 11.1 11.6911 11.3574 11.7745 11.5454L12.8085 13.5537C12.835 13.6052 12.8845 13.6409 12.9417 13.6497L15.395 14.0282C15.3479 13.7709 15.1447 13.5589 14.8718 13.5145L13.1588 13.236L12.2279 11.4381C12.1445 11.2501 12.0135 10.9926 11.7242 10.9064L10.6372 10.5802C10.5179 10.5512 10.4032 10.5405 10.1998 10.5725L9.74707 10.6776Z" fill="#00BEF7"/>
<path d="M12.7115 16.498C12.6869 16.4446 12.655 16.3948 12.6167 16.3502L11.2833 14.794L11.7419 13.266L11.6837 13.1536C11.6079 13.0072 11.3924 13.0273 11.345 13.1852L10.8916 14.6961C10.8532 14.824 10.8825 14.9627 10.9694 15.0642L12.1634 16.4576C12.2016 16.5023 12.2335 16.552 12.2581 16.6054L13.2379 18.7328C13.3691 19.0176 13.2716 19.3488 13.0223 19.5213C13.0525 19.5257 13.0831 19.528 13.1138 19.528C13.2028 19.528 13.2933 19.5092 13.3795 19.4695C13.6987 19.3224 13.8382 18.9445 13.6913 18.6254L12.7115 16.498Z" fill="#00BEF7"/>
<path d="M4.22827 18.567C4.06064 18.567 3.92032 18.436 3.91092 18.2666C3.83839 16.9594 4.84282 15.8369 6.14991 15.7644C6.32574 15.7553 6.47551 15.8889 6.4852 16.0643C6.49493 16.2398 6.36065 16.3899 6.1852 16.3996C5.22834 16.4528 4.49305 17.2745 4.54616 18.2313C4.5559 18.4067 4.42162 18.5568 4.24617 18.5666C4.2402 18.5669 4.23419 18.567 4.22827 18.567Z" fill="#00BEF7"/>
<path d="M5.51838 18.5804C5.35076 18.5804 5.21044 18.4493 5.20104 18.2799C5.16524 17.635 5.66082 17.0812 6.3057 17.0454C6.48081 17.0358 6.63121 17.17 6.64094 17.3454C6.65068 17.5209 6.51636 17.671 6.34091 17.6807C6.04634 17.6971 5.81994 17.95 5.83627 18.2447C5.84601 18.4201 5.71169 18.5702 5.53624 18.5799C5.53032 18.5802 5.52431 18.5804 5.51838 18.5804Z" fill="#00BEF7"/>
<path d="M17.7606 13.7491C17.7576 13.7491 17.7546 13.749 17.7516 13.749C17.576 13.744 17.4376 13.5977 17.4425 13.4221C17.4691 12.4641 16.7115 11.663 15.7536 11.6364C15.578 11.6315 15.4396 11.4851 15.4445 11.3095C15.4494 11.1339 15.5966 10.9955 15.7713 11.0004C17.0799 11.0368 18.115 12.1311 18.0785 13.4398C18.0737 13.6124 17.9322 13.7491 17.7606 13.7491Z" fill="#00BEF7"/>
<path d="M16.4716 13.7978C16.4686 13.7978 16.4656 13.7978 16.4626 13.7977C16.287 13.7928 16.1486 13.6465 16.1535 13.4708C16.1575 13.328 16.1055 13.1921 16.0074 13.0882C15.9091 12.9844 15.7763 12.925 15.6335 12.921C15.4579 12.9161 15.3195 12.7698 15.3243 12.5942C15.3293 12.4186 15.474 12.2798 15.6512 12.2851C15.964 12.2938 16.2546 12.4238 16.4696 12.6511C16.6846 12.8784 16.7982 13.1758 16.7895 13.4886C16.7846 13.6611 16.6432 13.7978 16.4716 13.7978Z" fill="#00BEF7"/>
</svg>

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -179,7 +179,8 @@ class DeviceManagerBloc extends Bloc<DeviceManagerEvent, DeviceManagerState> {
DeviceType.ThreeGang,
DeviceType.OneGang,
DeviceType.TwoGang,
DeviceType.WH
DeviceType.WH,
DeviceType.FlushMountedSensor,
};
return devices

View File

@ -107,6 +107,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
for (var element in tempTasksList) {
if (element.code == event.deviceControlModel.code) {
var updatedElement = element.copyWith(
deviceType: event.deviceType,
operationName: event.operation,
deviceName: event.deviceName,
icon: event.icon,
@ -134,6 +135,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
if (element.deviceId == event.deviceControlModel.deviceId &&
element.code == event.deviceControlModel.code) {
var updatedElement = element.copyWith(
deviceType: event.deviceType,
operationName: event.operation,
deviceName: event.deviceName,
icon: event.icon,

View File

@ -41,7 +41,7 @@ class SmartSceneSelectBloc
.read<CreateSceneBloc>();
createSceneBloc.add(TempHoldSceneTasksEvent(
deviceType: '',
deviceType:smartSceneEnable!.type ,
deviceControlModel: DeviceControlModel(
deviceId: smartSceneEnable?.entityId ?? '',
code: CreateSceneEnum.smartSceneSelect.name,

View File

@ -9,6 +9,7 @@ class ACFunctionsHelper {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -30,6 +31,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFreezing,
@ -56,6 +58,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsTempreture,
@ -72,6 +75,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFanSpeed,
@ -103,6 +107,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsChildLock,
@ -130,6 +135,7 @@ class ACFunctionsHelper {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -151,6 +157,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFreezing,
@ -177,6 +184,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsTempreture,
@ -196,6 +204,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsCurrentTemp,
@ -215,6 +224,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFanSpeed,
@ -246,6 +256,7 @@ class ACFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'AC',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsChildLock,

View File

@ -8,6 +8,7 @@ class DoorLockHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsDoorLock,
@ -16,8 +17,10 @@ class DoorLockHelperFunctions {
code: 'normal_open_switch',
operationDialogType: OperationDialogType.onOff,
operationalValues: [
SceneOperationalValue(icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
];
@ -28,6 +31,7 @@ class DoorLockHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFingerprintUnlock,
@ -47,6 +51,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsPasswordUnlock,
@ -66,6 +71,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsCardUnlock,
@ -85,6 +91,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLockAlarm,
@ -101,6 +108,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsRemoteUnlockReq,
@ -120,6 +128,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsResidualElectricity,
@ -139,6 +148,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsDoubleLock,
@ -160,6 +170,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsRemoteUnlockViaApp,
@ -179,6 +190,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsHijackAlarm,
@ -200,6 +212,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsDoorlockNormalOpen,
@ -221,6 +234,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsDoorlockNormalOpen,
@ -242,6 +256,7 @@ class DoorLockHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'DL',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsTempPasswordUnlock,

View File

@ -0,0 +1,247 @@
import 'package:syncrow_app/features/scene/enum/operation_dialog_type.dart';
import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
import 'package:syncrow_app/generated/assets.dart';
class FlushFunctionsHelper {
static List<SceneStaticFunction> flushSceneHelperFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsPresenceState,
operationName: 'Presence State',
code: 'presence_state',
functionValue: functionValue,
operationDialogType: OperationDialogType.listOfOptions,
operationalValues: [
SceneOperationalValue(
icon: Assets.nobodyTime, description: "None", value: 'none'),
SceneOperationalValue(
icon: Assets.nobodyTime,
description: "Presence",
value: 'presence',
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.IlluminanceIcon,
operationName: 'Illuminance Value',
code: 'illum_value',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
value: 0.0,
description: "",
minValue: 0.0,
maxValue: 2000.0,
stepValue: 1.0,
),
],
),
];
}
static List<SceneStaticFunction> flushAutomationFunctions(
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSensitivityFunction,
operationName: 'Sensitivity',
code: 'sensitivity',
functionValue: functionValue,
operationDialogType: OperationDialogType.listOfOptions,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 1,
description: 1.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 2,
description: 2.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 3,
description: 3.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 4,
description: 4.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 5,
description: 5.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 6,
description: 6.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 7,
description: 7.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 8,
description: 8.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 9,
description: 9.toString(),
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.currentDistanceIcon,
operationName: 'Min Detection Distance',
code: 'near_detection',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
value: 0.0,
description: "m",
minValue: 0.0,
maxValue: 9.5,
stepValue: 0.10,
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.currentDistanceIcon,
operationName: 'Max Detection Distance',
code: 'far_detection',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
value: 0.0,
description: "m",
minValue: 0.0,
maxValue: 9.5,
stepValue: 0.10,
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.levelIcon,
operationName: 'Trigger Level',
code: 'sensi_reduce',
functionValue: functionValue,
operationDialogType: OperationDialogType.listOfOptions,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 1,
description: 1.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 2,
description: 2.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 3,
description: 3.toString(),
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.indentLevelIcon,
operationName: 'Indent Level',
code: 'occur_dist_reduce',
functionValue: functionValue,
operationDialogType: OperationDialogType.listOfOptions,
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 1,
description: 1.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 2,
description: 2.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 3,
description: 3.toString(),
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.targetConfirmTimeIcon,
operationName: 'Target Confirm Time',
code: 'presence_delay',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
value: 0.0,
description: "",
minValue: 0.0,
maxValue: 0.5,
stepValue: 0.1,
),
],
),
SceneStaticFunction(
deviceType: 'NCPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.delayIcon,
operationName: 'Disappear Delay',
code: 'none_delay',
functionValue: functionValue,
operationDialogType: OperationDialogType.integerSteps,
operationalValues: [
SceneOperationalValue(
icon: '',
value: 20.0,
description: "",
minValue: 20.0,
maxValue: 300.0,
stepValue: 1.0,
),
],
),
];
}
}

View File

@ -7,6 +7,7 @@ class GatewayHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'GW',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSwitchAlarmSound,
@ -22,6 +23,7 @@ class GatewayHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'GW',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsMasterState,
@ -43,6 +45,7 @@ class GatewayHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'GW',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFactoryReset,

View File

@ -7,6 +7,7 @@ class HumanPresenceHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFarDetection,
@ -66,6 +67,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsMotionDetection,
@ -102,6 +104,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsMotionlessDetection,
@ -143,6 +146,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIndicator,
@ -164,6 +168,7 @@ class HumanPresenceHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsPresenceState,
@ -185,6 +190,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsPresenceSensorAssetsDistance,
@ -204,6 +210,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsPresenceSensorAssetsIlluminanceValue,
@ -223,6 +230,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIndicator,
@ -238,6 +246,7 @@ class HumanPresenceHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'WPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsPresenceSensorAssetsTime,

View File

@ -7,6 +7,7 @@ class PresenceSensorHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'CPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSensitivityFunction,
@ -74,6 +75,7 @@ class PresenceSensorHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'CPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsSensors,
@ -100,6 +102,7 @@ class PresenceSensorHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'CPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSensitivityFunction,
@ -119,6 +122,7 @@ class PresenceSensorHelperFunctions {
],
),
SceneStaticFunction(
deviceType: 'CPS',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSelfTestResult,

View File

@ -7,6 +7,7 @@ class TowGangHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -22,6 +23,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
@ -34,6 +36,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -49,6 +52,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
@ -67,6 +71,7 @@ class TowGangHelperFunctions {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -82,6 +87,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
@ -101,6 +107,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -116,6 +123,7 @@ class TowGangHelperFunctions {
],
),
SceneStaticFunction(
deviceType: '2G',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,

View File

@ -7,6 +7,7 @@ class WaterHeaterFunctionsHelper {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -27,6 +28,7 @@ class WaterHeaterFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
@ -45,6 +47,7 @@ class WaterHeaterFunctionsHelper {
String deviceId, String deviceName, functionValue) {
return [
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.refreshStatusIcon,
@ -71,6 +74,7 @@ class WaterHeaterFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsAcPower,
@ -86,6 +90,7 @@ class WaterHeaterFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsLightCountdown,
@ -105,6 +110,7 @@ class WaterHeaterFunctionsHelper {
],
),
SceneStaticFunction(
deviceType: 'WH',
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIndicator,

View File

@ -88,6 +88,7 @@ mixin SceneLogicHelper {
final task = actions[index];
if (task.deviceId == 'delay') {
return CreateSceneAction(
productType: task.deviceType,
entityId: actions[index].deviceId,
actionExecutor: 'delay',
executorProperty: CreateSceneExecutorProperty(
@ -99,6 +100,7 @@ mixin SceneLogicHelper {
}
if (task.code == CreateSceneEnum.smartSceneSelect.name) {
return CreateSceneAction(
productType: task.deviceType,
actionType: task.operationName.toLowerCase() == 'automation'
? 'automation'
: 'scene',
@ -107,6 +109,7 @@ mixin SceneLogicHelper {
executorProperty: null);
}
return CreateSceneAction(
productType: task.deviceType,
entityId: task.deviceId,
actionExecutor: 'device_issue',
executorProperty: CreateSceneExecutorProperty(
@ -119,6 +122,20 @@ mixin SceneLogicHelper {
),
],
);
for (var action in createAutomationModel.actions) {
if (action.productType == 'NCPS') {
if (action.executorProperty!.functionCode == 'near_detection' ||
action.executorProperty!.functionCode == 'far_detection') {
action.executorProperty!.functionValue =
(action.executorProperty!.functionValue * 100).round();
} else if (action.executorProperty!.functionCode ==
'presence_delay' ||
action.executorProperty!.functionCode == 'none_delay') {
action.executorProperty!.functionValue =
action.executorProperty!.functionValue * 10;
}
}
}
sceneBloc.add(CreateSceneWithTasksEvent(
createSceneModel: null,
updateScene: updateScene,
@ -139,6 +156,7 @@ mixin SceneLogicHelper {
final task = actions[index];
if (task.deviceId == 'delay') {
return CreateSceneAction(
productType: task.deviceType,
entityId: actions[index].deviceId,
actionExecutor: 'delay',
executorProperty: CreateSceneExecutorProperty(
@ -150,11 +168,14 @@ mixin SceneLogicHelper {
}
if (task.code == CreateSceneEnum.smartSceneSelect.name) {
return CreateSceneAction(
productType: task.deviceType,
entityId: actions[index].deviceId,
actionExecutor: actions[index].functionValue,
executorProperty: null);
}
return CreateSceneAction(
productType: task.deviceType,
entityId: task.deviceId,
actionExecutor: 'device_issue',
executorProperty: CreateSceneExecutorProperty(
@ -167,6 +188,20 @@ mixin SceneLogicHelper {
),
],
);
for (var action in createSceneModel.actions) {
if (action.productType == 'NCPS') {
if (action.executorProperty!.functionCode == 'near_detection' ||
action.executorProperty!.functionCode == 'far_detection') {
action.executorProperty!.functionValue =
action.executorProperty!.functionValue * 100;
} else if (action.executorProperty!.functionCode ==
'presence_delay' ||
action.executorProperty!.functionCode == 'none_delay') {
action.executorProperty!.functionValue =
action.executorProperty!.functionValue * 10;
}
}
}
sceneBloc.add(CreateSceneWithTasksEvent(
createSceneModel: createSceneModel,
createAutomationModel: null,

View File

@ -4,6 +4,7 @@ import 'package:syncrow_app/features/scene/enum/create_scene_enum.dart';
import 'package:syncrow_app/features/scene/enum/operation_dialog_type.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/ac_functions.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/door_lock_functions.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/flush_functions_helper.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/gateway_functions.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/human_presence_functions.dart';
import 'package:syncrow_app/features/scene/helper/functions_per_device/one_gang_functions.dart';
@ -18,7 +19,7 @@ import 'package:syncrow_app/utils/resource_manager/constants.dart';
mixin SceneOperationsDataHelper {
final Map<DeviceType,
Function(List<FunctionModel>, String, String, dynamic, bool)>
Function(List<FunctionModel>, String, String, dynamic, bool, String)>
_functionMap = {
DeviceType.LightBulb: lightBulbFunctions,
DeviceType.CeilingSensor: ceilingSensorFunctions,
@ -31,6 +32,7 @@ mixin SceneOperationsDataHelper {
DeviceType.OneGang: oneGangFunctions,
DeviceType.TwoGang: towGangFunctions,
DeviceType.WH: waterHeaterFunctions,
DeviceType.FlushMountedSensor: flushFunctions
};
final Map<DeviceType, String> _titleMap = {
@ -45,14 +47,33 @@ mixin SceneOperationsDataHelper {
DeviceType.OneGang: '1G Light Switch Conditions',
DeviceType.TwoGang: '2G Light Switch Conditions',
DeviceType.WH: 'Water Heater Conditions',
DeviceType.FlushMountedSensor: 'Flush Presence Sensor Functions'
};
static List<SceneStaticFunction> flushFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return FlushFunctionsHelper.flushSceneHelperFunctions(
deviceId, deviceName, functionValue);
}
return FlushFunctionsHelper.flushAutomationFunctions(
deviceId, deviceName, functionValue);
}
static List<SceneStaticFunction> waterHeaterFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return WaterHeaterFunctionsHelper.waterHeaterAutomationFunctions(
deviceId, deviceName, functionValue);
@ -63,11 +84,13 @@ mixin SceneOperationsDataHelper {
//one gang functions
static List<SceneStaticFunction> oneGangFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return OneGangHelperFunctions.oneGangAutomationFunctions(
deviceId, deviceName, functionValue);
@ -77,11 +100,13 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> towGangFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return TowGangHelperFunctions.towGangAutomationFunctions(
deviceId, deviceName, functionValue);
@ -95,13 +120,14 @@ mixin SceneOperationsDataHelper {
required List<FunctionModel> functions,
required String deviceId,
required String deviceName,
required String productType,
required bool isAutomation,
}) {
final functionValue = null;
return _functionMap[type]?.call(
functions, deviceId, deviceName, functionValue, isAutomation) ??
lightBulbFunctions(
functions, deviceId, deviceName, functionValue, isAutomation);
return _functionMap[type]?.call(functions, deviceId, deviceName,
functionValue, isAutomation, productType) ??
lightBulbFunctions(functions, deviceId, deviceName, functionValue,
isAutomation, productType);
}
String getTitle({DeviceType? type}) {
@ -109,11 +135,13 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> ceilingSensorFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return PresenceSensorHelperFunctions.automationPresenceSensorFunctions(
deviceId, deviceName, functionValue);
@ -123,20 +151,24 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> curtainFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
return [];
}
static List<SceneStaticFunction> doorLockFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return DoorLockHelperFunctions.doorLockAutomationFunctions(
deviceId, deviceName, functionValue);
@ -146,11 +178,13 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> wallSensorFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return HumanPresenceHelperFunctions.automationHumanPresenceFunctions(
deviceId, deviceName, functionValue);
@ -164,26 +198,31 @@ mixin SceneOperationsDataHelper {
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
bool isAutomation,
String productType) {
return [];
}
static List<SceneStaticFunction> gatewayFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
return GatewayHelperFunctions.tabToRunGatewayFunctions(
deviceId, deviceName, functionValue);
}
static List<SceneStaticFunction> threeGangFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return ThreeGangHelperFunctions.threeGangAutomationFunctions(
deviceId, deviceName, functionValue);
@ -193,11 +232,13 @@ mixin SceneOperationsDataHelper {
}
static List<SceneStaticFunction> acFunctions(
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation) {
List<FunctionModel> functions,
String deviceId,
String deviceName,
dynamic functionValue,
bool isAutomation,
String productType,
) {
if (isAutomation) {
return ACFunctionsHelper.automationAcFunctions(
deviceId, deviceName, functionValue);
@ -212,7 +253,19 @@ mixin SceneOperationsDataHelper {
List<Condition>? conditions,
}) {
List<SceneStaticFunction> functions = [];
for (var action in actions) {
if (action.productType == "NCPS") {
if (action.executorProperty!.functionCode == 'near_detection' ||
action.executorProperty!.functionCode == 'far_detection') {
action.executorProperty!.functionValue =
action.executorProperty!.functionValue / 100;
} else if (action.executorProperty!.functionCode == 'presence_delay' ||
action.executorProperty!.functionCode == 'none_delay') {
action.executorProperty!.functionValue =
(action.executorProperty!.functionValue / 10);
}
}
}
// Handle actions
for (var action in actions) {
if (action.entityId == 'delay') {
@ -306,11 +359,9 @@ mixin SceneOperationsDataHelper {
String? uniqueCustomId,
}) {
final executorProperty = action.executorProperty;
final Map<String,
SceneStaticFunction Function(Action, bool, String?, String?)>
functionMap = {
'sensitivity': _createSensitivityFunction,
'normal_open_switch': _createNormalOpenSwitchFunction,
'unlock_fingerprint': _createUnlockFingerprintFunction,
'unlock_password': _createUnlockPasswordFunction,
@ -323,12 +374,21 @@ mixin SceneOperationsDataHelper {
'hijack': _createHijackFunction,
'doorbell': _createDoorbellFunction,
'unlock_temporary': _createUnlockTemporaryFunction,
'far_detection': _createFarDetectionFunction,
'near_detection': _createNearDetectionOptions,
if (action.productType == 'NCPS') ...{
'far_detection': _createFarDetectionOptionsFlush,
'presence_state': _createPresenceStateFunctionFlush,
'illum_value': _createIlluminanceValueFunctionFlush,
'sensitivity': _createSensitivityFunctionFlush,
} else ...{
'far_detection': _createFarDetectionFunction,
'presence_state': _createPresenceStateFunction,
'sensitivity': _createSensitivityFunction,
},
'motion_sensitivity_value': _createMotionSensitivityFunction,
'motionless_sensitivity': _createMotionlessSensitivityFunction,
'indicator': _createIndicatorFunction,
'presence_time': _createPresenceTimeFunction,
'presence_state': _createPresenceStateFunction,
'dis_current': _createDisCurrentFunction,
'illuminance_value': _createIlluminanceValueFunction,
'checking_result': _createCheckingResultFunction,
@ -349,6 +409,10 @@ mixin SceneOperationsDataHelper {
'factory_reset': _createFactoryResetFunction,
'switch_backlight': _createSwitchFunction,
'relay_status': _relayStatusSwitchFunction,
'sensi_reduce': _createTriggerLevelOptions,
'occur_dist_reduce': _createIndentLevelOptions,
'presence_delay': _createTargetConfirmTime,
'none_delay': _createDisappeDelay
};
final functionCode = executorProperty?.functionCode ?? '';
@ -372,7 +436,6 @@ mixin SceneOperationsDataHelper {
String? uniqueCustomId,
]) {
final productType = action.productType;
final functionValue = action.executorProperty?.functionValue;
return SceneStaticFunction(
deviceType: productType,
@ -765,17 +828,36 @@ mixin SceneOperationsDataHelper {
SceneStaticFunction _createSwitchFunction(Action action, bool isAutomation,
String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.waterHeaterIcon,
'Power',
OperationDialogType.onOff,
_createOnOffOptions(),
isAutomation,
comparator,
uniqueCustomId,
);
switch (action.productType) {
case "AC":
return _createSceneFunction(
action,
action.deviceName,
Assets.assetsIconsAC,
'Switch',
OperationDialogType.onOff,
_createOnOffOptions(),
isAutomation,
comparator,
uniqueCustomId,
);
case "WH":
return _createSceneFunction(
action,
action.deviceName,
Assets.waterHeaterIcon,
'Power',
OperationDialogType.onOff,
_createOnOffOptions(),
isAutomation,
comparator,
uniqueCustomId,
);
default:
throw ArgumentError('Unsupported product type: ${action.productType}');
}
}
SceneStaticFunction _relayStatusSwitchFunction(Action action,
@ -875,6 +957,19 @@ mixin SceneOperationsDataHelper {
static SceneStaticFunction _createSwitch1Function(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
switch (action.productType) {
case "AC":
return _createSceneFunction(
action,
action.deviceName,
Assets.acSwitchIcon,
'Switch',
OperationDialogType.onOff,
_createOnOffOptions(),
isAutomation,
comparator,
uniqueCustomId,
);
case "WH":
return _createSceneFunction(
action,
@ -1349,6 +1444,21 @@ mixin SceneOperationsDataHelper {
];
}
List<SceneOperationalValue> _createPresenceStateOptionsFlush() {
return [
SceneOperationalValue(
icon: Assets.assetsIconsPresenceSensorAssetsEmpty,
value: 'none',
description: 'None',
),
SceneOperationalValue(
icon: Assets.assetsPresence,
value: 'presence',
description: 'Presence',
),
];
}
List<SceneOperationalValue> _createPresenceStateOptions() {
return [
SceneOperationalValue(
@ -1582,7 +1692,7 @@ mixin SceneOperationsDataHelper {
return [
_mapExecutorPropertyToSceneFunction(
Action(
deviceName: taskItem.deviceName,
deviceName: taskItem.deviceName!,
productType: taskItem.deviceType!,
entityId: deviceId,
executorProperty: ExecutorProperty(
@ -1630,4 +1740,296 @@ mixin SceneOperationsDataHelper {
),
];
}
SceneStaticFunction _createNearDetectionOptions(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Min Detection distance',
OperationDialogType.integerSteps,
_createMinDetection(),
isAutomation,
comparator,
uniqueCustomId,
);
}
SceneStaticFunction _createFarDetectionOptionsFlush(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Max Detection distance',
OperationDialogType.integerSteps,
_createFarDetection(),
isAutomation,
comparator,
uniqueCustomId,
);
}
SceneStaticFunction _createTriggerLevelOptions(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
"Trigger Level",
OperationDialogType.listOfOptions,
_createTriggerLevelFunction(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _createTriggerLevelFunction() {
return [
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
description: "1",
value: 1,
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
description: "2",
value: 2,
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
description: "3",
value: 3,
),
];
}
SceneStaticFunction _createIndentLevelOptions(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Indent Level',
OperationDialogType.listOfOptions,
_createIndentLevelFunction(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _createIndentLevelFunction() {
return [
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
description: "1",
value: 1,
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
description: "2",
value: 2,
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
description: "3",
value: 3,
),
];
}
SceneStaticFunction _createTargetConfirmTime(Action action, bool isAutomation,
String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Target Confirm Time',
OperationDialogType.integerSteps,
_targetConfirmTimeFun(),
isAutomation,
comparator,
uniqueCustomId,
);
}
SceneStaticFunction _createDisappeDelay(Action action, bool isAutomation,
String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Disappe Delay',
OperationDialogType.integerSteps,
_targetDisappeDelayFun(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _targetDisappeDelayFun() {
return [
SceneOperationalValue(
icon: Assets.flushIcon,
value: 0.0,
description: '',
minValue: 20,
maxValue: 300,
stepValue: 1,
),
];
}
List<SceneOperationalValue> _createFarDetection() {
return [
SceneOperationalValue(
icon: '',
description: "m",
value: 0.0,
minValue: 0.0,
maxValue: 9.5,
stepValue: 1,
),
];
}
List<SceneOperationalValue> _createMinDetection() {
return [
SceneOperationalValue(
icon: '',
description: "m",
value: 0.0,
minValue: 0.0,
maxValue: 9.5,
stepValue: 1,
),
];
}
List<SceneOperationalValue> _targetConfirmTimeFun() {
return [
SceneOperationalValue(
icon: Assets.assetsCelsiusDegrees,
value: 0.0,
description: '',
minValue: 0.0,
maxValue: 0.5,
stepValue: 0.1,
),
];
}
SceneStaticFunction _createPresenceStateFunctionFlush(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Presence State',
OperationDialogType.listOfOptions,
_createPresenceStateOptionsFlush(),
isAutomation,
comparator,
uniqueCustomId,
);
}
SceneStaticFunction _createIlluminanceValueFunctionFlush(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Illuminance Value',
OperationDialogType.integerSteps,
_createIlluminanceValueOptionsFlush(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _createIlluminanceValueOptionsFlush() {
return [
SceneOperationalValue(
icon: '',
value: 0.0,
description: "Lux",
minValue: 0,
maxValue: 10000,
stepValue: 1,
),
];
}
SceneStaticFunction _createSensitivityFunctionFlush(Action action,
bool isAutomation, String? comparator, String? uniqueCustomId) {
return _createSceneFunction(
action,
action.deviceName,
Assets.flushIcon,
'Sensitivity',
isAutomation
? OperationDialogType.integerSteps
: OperationDialogType.listOfOptions,
_createIntegerStepsOptionsFlush(),
isAutomation,
comparator,
uniqueCustomId,
);
}
List<SceneOperationalValue> _createIntegerStepsOptionsFlush() {
return [
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 1,
description: 1.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 2,
description: 2.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 3,
description: 3.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 4,
description: 4.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 5,
description: 5.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 6,
description: 6.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 7,
description: 7.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 8,
description: 8.toString(),
),
SceneOperationalValue(
icon: Assets.assetsSensitivityOperationIcon,
value: 9,
description: 9.toString(),
),
];
}
}

View File

@ -94,6 +94,8 @@ class CreateSceneModel {
}
class CreateSceneAction {
final String? productType;
String entityId;
String? actionType;
String actionExecutor;
@ -104,15 +106,18 @@ class CreateSceneAction {
required this.entityId,
required this.actionExecutor,
required this.executorProperty,
required this.productType,
});
CreateSceneAction copyWith({
String? productType,
String? actionType,
String? entityId,
String? actionExecutor,
CreateSceneExecutorProperty? executorProperty,
}) {
return CreateSceneAction(
productType: productType,
actionType: actionType,
entityId: entityId ?? this.entityId,
actionExecutor: actionExecutor ?? this.actionExecutor,
@ -126,18 +131,21 @@ class CreateSceneAction {
'entityId': entityId,
'actionExecutor': actionExecutor,
'executorProperty': executorProperty?.toMap(actionExecutor),
// 'productType': productType,
};
} else {
return {
"actionType": actionType,
'entityId': entityId,
'actionExecutor': actionExecutor,
// 'productType': productType,
};
}
}
factory CreateSceneAction.fromMap(Map<String, dynamic> map) {
return CreateSceneAction(
productType: map['productType'] ?? '',
entityId: map['entityId'] ?? '',
actionExecutor: map['actionExecutor'] ?? '',
executorProperty:

View File

@ -75,7 +75,6 @@ class Action {
String? name;
String? type;
final String productType;
final String deviceName;
Action({
@ -91,39 +90,57 @@ class Action {
String toRawJson() => json.encode(toJson());
static Action? fromJson(Map<String, dynamic> json) {
if (json['name'] != null && json['type'] != null) {
return Action(
actionExecutor: json["actionExecutor"] as String,
entityId: json["entityId"] as String,
name: json['name'] as String?,
type: json['type'] as String?,
productType: json['productType'] as String,
deviceName: json['deviceName'] as String,
);
}
if (json["executorProperty"] == null) {
// Safely extract required fields with null checks
final String? actionExecutor = json["actionExecutor"] as String?;
final String? entityId = json["entityId"] as String?;
final String? productType = json['productType'] as String?;
final String? deviceName = json['deviceName'] as String?;
// Skip invalid actions with missing required fields
if (actionExecutor == null ||
entityId == null ||
productType == null ||
deviceName == null) {
return null;
}
return Action(
actionExecutor: json["actionExecutor"] as String,
entityId: json["entityId"] as String,
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
productType: json['productType'] as String,
deviceName: json['deviceName'] as String,
);
// Handle actions with 'name' and 'type'
if (json['name'] != null && json['type'] != null) {
return Action(
actionExecutor: actionExecutor,
entityId: entityId,
name: json['name'] as String?,
type: json['type'] as String?,
productType: productType,
deviceName: deviceName,
);
}
// Handle actions with 'executorProperty'
if (json["executorProperty"] != null) {
return Action(
actionExecutor: actionExecutor,
entityId: entityId,
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
productType: productType,
deviceName: deviceName,
);
}
return null; // Skip invalid actions
}
Map<String, dynamic> toJson() => {
"actionExecutor": actionExecutor,
"entityId": entityId,
"executorProperty": executorProperty?.toJson(),
// "productType": productType
};
}
class ExecutorProperty {
final String? functionCode;
final dynamic functionValue;
dynamic functionValue;
final dynamic delaySeconds;
ExecutorProperty({

View File

@ -12,7 +12,7 @@ class SceneStaticFunction {
final String deviceId;
final String operationName;
final String? uniqueCustomId;
final dynamic functionValue;
dynamic functionValue;
final String? deviceIcon;
final OperationDialogType operationDialogType;
final String? comparator;
@ -29,7 +29,7 @@ class SceneStaticFunction {
this.deviceIcon,
required this.operationDialogType,
this.comparator,
this.deviceType,
this.deviceType,
String? uniqueCustomId,
}) : uniqueCustomId = uniqueCustomId ?? const Uuid().v4();
@ -127,7 +127,8 @@ class SceneStaticFunction {
other.uniqueCustomId == uniqueCustomId &&
other.operationDialogType == operationDialogType &&
listEquals(other.operationalValues, operationalValues) &&
other.deviceId == deviceId && other.deviceType == deviceType;
other.deviceId == deviceId &&
other.deviceType == deviceType;
}
@override
@ -142,7 +143,8 @@ class SceneStaticFunction {
comparator.hashCode ^
uniqueCustomId.hashCode ^
operationDialogType.hashCode ^
operationalValues.hashCode ^ deviceType.hashCode;
operationalValues.hashCode ^
deviceType.hashCode;
}
}

View File

@ -26,20 +26,20 @@ class DeviceFunctionsView extends StatelessWidget
Widget build(BuildContext context) {
final device = (ModalRoute.of(context)?.settings.arguments as Map)['device']
as DeviceModel;
final isAutomation = (ModalRoute.of(context)?.settings.arguments
as Map)['isAutomationDeviceStatus'] as bool;
List<SceneStaticFunction> functions = [];
if (device.functions.isNotEmpty) {
functions = getFunctionsWithIcons(
type: device.productType,
functions: device.functions,
deviceId: device.uuid ?? '',
deviceName: device.name ?? '',
isAutomation: isAutomation,
);
}
// if (device.functions.isNotEmpty) {
functions = getFunctionsWithIcons(
productType: device.type ?? '',
type: device.productType,
functions: device.functions,
deviceId: device.uuid ?? '',
deviceName: device.name ?? '',
isAutomation: isAutomation,
);
// }
return DefaultScaffold(
title: getTitle(type: device.productType),
@ -257,7 +257,7 @@ class DeviceFunctionsView extends StatelessWidget
deviceName: device.name ?? '',
uniqueId: function.uniqueCustomId!,
operationType: function.operationDialogType,
deviceType: '',
deviceType: function.deviceType!,
));
Navigator.pop(context);
},
@ -298,7 +298,7 @@ class DeviceFunctionsView extends StatelessWidget
return;
}
context.read<CreateSceneBloc>().add(TempHoldSceneTasksEvent(
deviceType: device.productType!.name,
deviceType: function.deviceType!,
deviceControlModel: DeviceControlModel(
deviceId: device.uuid,
code: function.code,

View File

@ -7,12 +7,12 @@ import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class AlertDialogSliderSteps extends StatefulWidget {
const AlertDialogSliderSteps({
super.key,
this.functionValue,
required this.taskItem,
required this.isAutomation,
});
const AlertDialogSliderSteps(
{super.key,
this.functionValue,
required this.taskItem,
required this.isAutomation,
});
final dynamic functionValue;
final SceneStaticFunction taskItem;
@ -108,67 +108,69 @@ class _AlertDialogSliderStepsState extends State<AlertDialogSliderSteps> {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
ToggleButtons(
isSelected: [
selectedToggleIndex == 0,
selectedToggleIndex == 1,
selectedToggleIndex == 2
],
onPressed: (index) {
setState(() {
selectedToggleIndex = index;
});
context.read<CreateSceneBloc>().add(
SelectedValueEvent(
value: _deNormalizeValue(groupValue),
code: widget.taskItem.code,
isAutomation: widget.isAutomation,
comparator: _indexToComparator(selectedToggleIndex),
widget.isAutomation
? ToggleButtons(
isSelected: [
selectedToggleIndex == 0,
selectedToggleIndex == 1,
selectedToggleIndex == 2
],
onPressed: (index) {
setState(() {
selectedToggleIndex = index;
});
context.read<CreateSceneBloc>().add(
SelectedValueEvent(
value: _deNormalizeValue(groupValue),
code: widget.taskItem.code,
isAutomation: widget.isAutomation,
comparator: _indexToComparator(selectedToggleIndex),
),
);
},
borderRadius: BorderRadius.circular(30),
selectedColor: Colors.white,
color: ColorsManager.blackColor,
fillColor: ColorsManager.primaryColorWithOpacity,
borderColor: ColorsManager.greyColor,
constraints: BoxConstraints.tight(const Size(70, 30)),
children: [
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 0
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text("<"),
),
),
);
},
borderRadius: BorderRadius.circular(30),
selectedColor: Colors.white,
color: ColorsManager.blackColor,
fillColor: ColorsManager.primaryColorWithOpacity,
borderColor: ColorsManager.greyColor,
constraints: BoxConstraints.tight(const Size(70, 30)),
children: [
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 0
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text("<"),
),
),
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 1
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text("="),
),
),
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 2
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text(">"),
),
),
],
),
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 1
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text("="),
),
),
SizedBox(
width: 70,
height: 30,
child: Container(
color: selectedToggleIndex == 2
? ColorsManager.primaryColorWithOpacity
: ColorsManager.greyColor,
alignment: Alignment.center,
child: const Text(">"),
),
),
],
)
: SizedBox(),
const SizedBox(height: 12),
...widget.taskItem.operationalValues.map(
(operation) => BlocBuilder<CreateSceneBloc, CreateSceneState>(

View File

@ -1156,4 +1156,9 @@ class Assets {
'assets/icons/target_confirm_time_icon.svg';
static const String disappeDelayIcon = 'assets/icons/disappe_delay_icon.svg';
static const String flushIcon = 'assets/icons/flush_icon.svg';
static const String IlluminanceIcon = 'assets/icons/Illuminance_icon.svg';
static const String nobodyTime = "assets/icons/nobody_time.svg";
static const String currentDistanceIcon = 'assets/icons/distance_icon.svg';
static const String delayIcon = 'assets/icons/delay_icon.svg';
static const String levelIcon = 'assets/icons/level_icon.svg';
}