connected rest of the devices and functions and trigger api

This commit is contained in:
ashrafzarkanisala
2024-06-29 18:24:33 +03:00
parent 320afb0ca8
commit 043e8c1e2d
24 changed files with 630 additions and 162 deletions

View File

@ -0,0 +1,10 @@
<svg width="17" height="22" viewBox="0 0 17 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.771 11.6328H8.13623L7.81885 11L8.13623 10.3672H8.771V11.6328Z" fill="#292827"/>
<path d="M7.50146 10.3672H8.13623V11.6328H7.50146V10.3672Z" fill="#464443"/>
<path d="M4.8042 10.3672H6.07373V11.6328H4.8042V10.3672Z" fill="#464443"/>
<path d="M10.1987 10.3672H11.4683V11.6328H10.1987V10.3672Z" fill="#292827"/>
<path d="M8.13626 2.88879C3.64275 2.88879 0 6.52029 0 11C0 13.0387 0.754651 14.9015 2.00036 16.3265L3.9143 14.4184C3.15343 13.4856 2.69708 12.296 2.69708 11C2.69708 8.00525 5.13225 5.57757 8.13621 5.57757H8.8105V2.88879H8.13626Z" fill="#30BBEC"/>
<path d="M14.2725 5.67358L12.3586 7.58168C13.1195 8.51449 13.5758 9.70409 13.5758 11.0001C13.5758 13.9949 11.1407 16.4225 8.13669 16.4225H7.4624V19.1113H8.13665C12.6302 19.1113 16.2729 15.4798 16.2729 11.0001C16.2729 8.96142 15.5183 7.09859 14.2725 5.67358Z" fill="#1F8DCD"/>
<path d="M8.13623 0.199951V8.26637L12.1819 4.23316L8.13623 0.199951Z" fill="#16A5D9"/>
<path d="M8.13648 21.8V13.7336L4.09082 17.7668L8.13648 21.8Z" fill="#16A5D9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,16 @@
<svg width="31" height="22" viewBox="0 0 31 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.2269 11.0832C18.2269 11.673 18.0501 12.2215 17.7466 12.6786C17.2293 13.4578 16.344 13.6188 15.3387 13.6188C13.7437 13.6188 12.8809 12.6783 12.8809 11.0832C12.8809 10.0769 12.9653 9.19071 13.7458 8.67368C14.2024 8.37122 14.75 8.19507 15.3387 8.19507C16.9338 8.19513 18.2269 9.48815 18.2269 11.0832Z" fill="#E5646E"/>
<path d="M16.1515 13.1592C14.5565 13.1592 13.2634 11.8662 13.2634 10.2711C13.2634 9.6813 13.443 9.13093 13.7464 8.67383C12.9673 9.19109 12.4512 10.0781 12.4512 11.0834C12.4512 12.6785 13.7442 13.9715 15.3393 13.9715C16.3446 13.9715 17.2299 13.4579 17.7472 12.6788C17.2901 12.9822 16.7413 13.1592 16.1515 13.1592Z" fill="#DB4655"/>
<path d="M5.46814 0.25C5.71448 0.25 5.9608 0.344021 6.14879 0.532062C6.15759 0.540863 6.16616 0.549781 6.17455 0.558816L5.6433 1.8934C3.18863 4.34814 1.83667 7.61186 1.83667 11.0833C1.83667 14.5548 3.18863 17.8185 5.6433 20.2733L6.17484 21.6075C6.16633 21.6167 6.15765 21.6257 6.14879 21.6346C5.77317 22.0107 5.16353 22.0107 4.78744 21.6346C1.96893 18.8163 0.416748 15.0691 0.416748 11.0833C0.416748 7.09758 1.96893 3.3504 4.7875 0.532062C4.97531 0.344021 5.22182 0.25 5.46814 0.25Z" fill="#FFE6E7"/>
<path d="M10.9137 5.69604C11.1601 5.69604 11.4066 5.79007 11.5944 5.97811C11.6135 5.99723 11.6316 6.01687 11.6487 6.03715L10.996 7.33939C8.93166 9.40394 8.93166 12.7631 10.996 14.8277L11.65 16.1285C11.6325 16.1493 11.6139 16.1694 11.5944 16.189C11.2187 16.5651 10.6086 16.5651 10.233 16.189C7.41777 13.374 7.41777 8.79312 10.233 5.97811C10.4208 5.79001 10.6674 5.69604 10.9137 5.69604Z" fill="#FF9A9F"/>
<path d="M8.19074 2.9729C8.43707 2.9729 8.6834 3.06692 8.87138 3.25496C8.88234 3.26592 8.89295 3.277 8.90327 3.28836L8.08168 4.61625C4.51619 8.1822 4.51619 13.9844 8.08168 17.5503L8.90396 18.8775C8.89347 18.8891 8.88263 18.9005 8.87144 18.9116C8.49536 19.2877 7.88618 19.2877 7.5101 18.9116C3.1939 14.5952 3.1939 7.57133 7.5101 3.25484C7.69808 3.06692 7.94441 2.9729 8.19074 2.9729Z" fill="#FFCCCF"/>
<path d="M9.08105 11.0833C9.08105 13.156 10.098 14.9895 11.6502 16.1283C11.9702 15.7502 11.9513 15.184 11.5945 14.8275C9.53023 12.7629 9.53023 9.40376 11.5945 7.33916C11.9513 6.98267 11.9689 6.41499 11.6489 6.03687C10.0967 7.1756 9.08105 9.0106 9.08105 11.0833Z" fill="#FF8086"/>
<path d="M5.23047 11.0833C5.23047 14.2196 6.66252 17.0234 8.9042 18.8775C9.24764 18.4998 9.23662 17.9151 8.87168 17.5503C5.30619 13.9844 5.30619 8.18223 8.87168 4.61627C9.23662 4.25156 9.24694 3.66604 8.90356 3.28833C6.66182 5.14239 5.23047 7.94698 5.23047 11.0833Z" fill="#FF9A9F"/>
<path d="M1.37939 11.0834C1.37939 15.2833 3.23969 19.0485 6.17484 21.6076C6.52481 21.2301 6.51601 20.6403 6.14879 20.2733C3.69406 17.8186 2.3421 14.5548 2.3421 11.0834C2.3421 7.61189 3.69406 4.34816 6.14879 1.89343C6.51601 1.52644 6.52452 0.936319 6.17455 0.558838C3.2394 3.11791 1.37939 6.88339 1.37939 11.0834Z" fill="#FFCCCF"/>
<path d="M25.2091 21.9167C24.9628 21.9167 24.7165 21.8226 24.5285 21.6346C24.5197 21.6258 24.5111 21.6169 24.5027 21.6079L25.034 20.2733C27.4887 17.8185 28.8406 14.5548 28.8406 11.0833C28.8406 7.61186 27.4887 4.34814 25.034 1.8934L24.5024 0.559166C24.511 0.550014 24.5196 0.54098 24.5285 0.532061C24.9041 0.15598 25.5138 0.15598 25.8898 0.532061C28.7084 3.3504 30.2605 7.09758 30.2605 11.0833C30.2605 15.0691 28.7084 18.8163 25.8898 21.6346C25.702 21.8226 25.4555 21.9167 25.2091 21.9167Z" fill="#FFE6E7"/>
<path d="M19.7632 16.4709C19.5168 16.4709 19.2703 16.3769 19.0825 16.1888C19.0634 16.1697 19.0453 16.1501 19.0281 16.1298L19.6809 14.8275C21.7452 12.763 21.7452 9.40381 19.6809 7.33921L19.0269 6.03837C19.0444 6.01761 19.0629 5.99745 19.0825 5.97786C19.4581 5.60178 20.0682 5.60178 20.4439 5.97786C23.2591 8.79288 23.2591 13.3738 20.4439 16.1888C20.2561 16.3769 20.0095 16.4709 19.7632 16.4709Z" fill="#FF9A9F"/>
<path d="M22.4867 19.1937C22.2403 19.1937 21.994 19.0997 21.806 18.9117C21.7951 18.9007 21.7845 18.8896 21.7741 18.8783L22.5957 17.5503C26.1612 13.9844 26.1612 8.1822 22.5957 4.61625L21.7734 3.28906C21.7839 3.27746 21.7948 3.26609 21.806 3.25496C22.182 2.87888 22.7912 2.87888 23.1673 3.25496C27.4835 7.57139 27.4835 14.5952 23.1673 18.9117C22.9793 19.0997 22.733 19.1937 22.4867 19.1937Z" fill="#FFCCCF"/>
<path d="M21.5966 11.0833C21.5966 9.01061 20.5797 7.17707 19.0275 6.03833C18.7075 6.41645 18.7264 6.98267 19.0832 7.33917C21.1475 9.40371 21.1475 12.7629 19.0832 14.8275C18.7264 15.184 18.7088 15.7516 19.0288 16.1298C20.581 14.991 21.5966 13.156 21.5966 11.0833Z" fill="#FF8086"/>
<path d="M25.4468 11.0833C25.4468 7.94701 24.0148 5.14318 21.7731 3.28906C21.4296 3.66678 21.4406 4.25153 21.8056 4.61625C25.3711 8.18221 25.3711 13.9844 21.8056 17.5503C21.4406 17.915 21.4303 18.5006 21.7737 18.8783C24.0155 17.0242 25.4468 14.2196 25.4468 11.0833Z" fill="#FF9A9F"/>
<path d="M29.2981 11.0836C29.2981 6.88358 27.4378 3.11845 24.5027 0.559326C24.1527 0.936807 24.1615 1.52658 24.5287 1.89357C26.9834 4.3483 28.3353 7.61202 28.3353 11.0835C28.3353 14.555 26.9834 17.8187 24.5287 20.2734C24.1615 20.6404 24.153 21.2305 24.503 21.608C27.4381 19.049 29.2981 15.2835 29.2981 11.0836Z" fill="#FFCCCF"/>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -0,0 +1,17 @@
<svg width="17" height="10" viewBox="0 0 17 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.1262 8.1101L5.22852 6.22034L8.06316 9.99986H16.1262V8.1101Z" fill="#FFB54C"/>
<path d="M0 8.1101V9.99986H8.06299V6.22034L0 8.1101Z" fill="#FFCC4A"/>
<path d="M16.1261 8.11012V3.85815H14.9371L14.4647 4.3306L13.9922 3.85815H12.8033L12.3308 4.3306L11.8584 3.85815H10.6694L10.197 4.3306L9.72452 3.85815H8.53554L6.17334 5.98414L8.0631 8.11012H16.1261Z" fill="#FFCC4A"/>
<path d="M8.06299 3.85815H7.59055H6.40157L5.92913 4.3306L5.45669 3.85815H4.26772L3.79528 4.3306L3.32283 3.85815H2.13386L1.66142 4.3306L1.18898 3.85815H0V8.11012H8.06299V3.85815Z" fill="#FFE278"/>
<path d="M15.6533 1.02356H8.06277L7.59033 1.496L8.06277 1.96844H15.6533V1.02356Z" fill="#ABD5ED"/>
<path d="M8.06299 1.02362H0.944882V0.0787354H0V2.91338H0.944882V1.9685H8.06299V1.02362Z" fill="#BFEBFF"/>
<path d="M15.1812 0.0786133H16.126V2.91326H15.1812V0.0786133Z" fill="#ABD5ED"/>
<path d="M1.18896 3.85815H2.13385V6.22036H1.18896V3.85815Z" fill="#587AA1"/>
<path d="M3.32275 3.85828H4.26764V5.2756H3.32275V3.85828Z" fill="#587AA1"/>
<path d="M5.45654 3.85828H6.40142V6.22048H5.45654V3.85828Z" fill="#587AA1"/>
<path d="M8.53532 5.27548H8.06288L7.82666 5.03926V4.09437L8.06288 3.85815H8.53532V5.27548Z" fill="#455F80"/>
<path d="M7.59033 3.85815H8.06277V5.27548H7.59033V3.85815Z" fill="#587AA1"/>
<path d="M9.72461 3.85815H10.6695V6.22036H9.72461V3.85815Z" fill="#455F80"/>
<path d="M11.8584 3.85815H12.8033V5.27548H11.8584V3.85815Z" fill="#455F80"/>
<path d="M13.9922 3.85815H14.9371V6.22036H13.9922V3.85815Z" fill="#455F80"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,12 @@
<svg width="16" height="23" viewBox="0 0 16 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.3977 15.4506V18.922C15.3977 19.7445 14.7285 20.4133 13.906 20.4133H1.49132C0.668788 20.4133 0 19.7445 0 18.922V15.4506C0 11.2053 3.45363 7.75171 7.69885 7.75171H7.73063C11.9615 7.7691 15.3977 11.2159 15.3977 15.4506Z" fill="#FF5B5B"/>
<path d="M15.3975 15.4506V18.922C15.3975 19.7445 14.7283 20.4133 13.9058 20.4133H7.73047V7.75171C11.9613 7.7691 15.3975 11.2159 15.3975 15.4506Z" fill="#FF193D"/>
<path d="M15.3977 16.2239V18.9223C15.3977 19.7448 14.7285 20.4136 13.906 20.4136H1.49132C0.668788 20.4136 0 19.7448 0 18.9223V16.2239H15.3977Z" fill="#7C8287"/>
<path d="M15.3977 21.8814C15.3977 22.2325 15.1131 22.5167 14.7624 22.5167H0.635315C0.284205 22.5167 0 22.2325 0 21.8814C0 21.5307 0.284205 21.2461 0.635315 21.2461H14.7623C15.1131 21.2461 15.3977 21.5307 15.3977 21.8814Z" fill="#DCE6EB"/>
<path d="M8.36731 1.48541V5.35621C8.36731 5.70689 8.08268 5.99152 7.73199 5.99152C7.38131 5.99152 7.09668 5.70689 7.09668 5.35621V1.48541C7.09664 1.13473 7.38127 0.850098 7.73199 0.850098C8.08272 0.850098 8.36731 1.13473 8.36731 1.48541Z" fill="#FFB64C"/>
<path d="M2.87856 7.33606C2.67031 7.33606 2.4663 7.23382 2.34472 7.04597L0.357991 3.97806C0.167266 3.68358 0.251393 3.29019 0.545924 3.09947C0.840412 2.9087 1.23376 2.99287 1.42452 3.2874L3.41125 6.3553C3.60198 6.64979 3.51785 7.04318 3.22332 7.2339C3.11659 7.30301 2.99688 7.33606 2.87856 7.33606Z" fill="#FFB64C"/>
<path d="M12.3077 7.33605C12.1894 7.33605 12.0697 7.303 11.9629 7.23389C11.6684 7.04317 11.5843 6.64978 11.775 6.35529L13.7617 3.28739C13.9524 2.99282 14.3457 2.90873 14.6403 3.09946C14.9348 3.29018 15.0189 3.68357 14.8283 3.97806L12.8415 7.04596C12.7199 7.23377 12.5159 7.33605 12.3077 7.33605Z" fill="#FF9F00"/>
<path d="M15.3975 21.8814C15.3975 22.2325 15.1129 22.5167 14.7622 22.5167H7.73047V21.2461H14.7622C15.1129 21.2461 15.3975 21.5307 15.3975 21.8814Z" fill="#C8D2DC"/>
<path d="M15.3975 16.2239V18.9223C15.3975 19.7448 14.7283 20.4136 13.9058 20.4136H7.73047V16.2239H15.3975Z" fill="#596C76"/>
<path d="M8.36725 1.48541V5.35621C8.36725 5.70689 8.08262 5.99152 7.73193 5.99152V0.850098C8.08262 0.850098 8.36725 1.13473 8.36725 1.48541Z" fill="#FF9F00"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,18 @@
<svg width="23" height="22" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.39622 0.199951H2.01953C1.31837 0.199951 0.75 0.766571 0.75 1.46558V16.4224L7.74254 16.8442L8.58889 8.31113L7.74254 0.621826L4.39622 0.199951Z" fill="#5A5F64"/>
<path d="M14.7347 1.46558C14.7347 0.766571 14.1664 0.199951 13.4652 0.199951H11.0885L7.74219 0.621826V16.8442L14.7347 16.4224V1.46558Z" fill="#373C41"/>
<path d="M0.75 16.4224V20.5343C0.75 21.2333 1.31837 21.8 2.01953 21.8H7.74254L8.58889 19.1112L7.74254 16.4224H0.75V16.4224Z" fill="#DCE6EB"/>
<path d="M7.74219 16.4224V21.8H13.4652C14.1664 21.8 14.7347 21.2333 14.7347 20.5343V16.4224H7.74219Z" fill="#C8D2DC"/>
<path d="M4.396 0.199951L4.84554 2.88873H7.74231L8.58867 1.54434L7.74231 0.199951H4.396Z" fill="#DCE6EB"/>
<path d="M11.0885 0.199951H7.74219V2.88873H10.639L11.0885 0.199951Z" fill="#C8D2DC"/>
<path d="M7.10742 18.4784V19.744H7.74219L8.16536 19.1112L7.74219 18.4784H7.10742Z" fill="#C8D2DC"/>
<path d="M7.74219 18.4785H8.37695V19.7441H7.74219V18.4785Z" fill="#A2ABB8"/>
<path d="M16.832 3.54602V5.59967H17.4668L17.89 4.57282L17.4668 3.54602H16.832Z" fill="#FFEB99"/>
<path d="M17.4668 3.54602H18.1016V5.59967H17.4668V3.54602Z" fill="#FFC477"/>
<path d="M13.5718 8.84427V11.4326H17.4668L18.3132 8.19791L17.4668 4.96323C15.3158 4.96213 13.5718 6.70017 13.5718 8.84427Z" fill="#FFC477"/>
<path d="M21.3578 8.88146C21.3578 6.74787 19.607 4.96435 17.4668 4.96326V11.4327H21.3578V8.88146Z" fill="#FF9F22"/>
<path d="M16.064 13.2839V14.5733C16.064 15.3445 16.6911 15.9697 17.4647 15.9697C17.4654 15.9697 17.466 15.9697 17.4667 15.9697L17.8899 14.375L17.4667 13.2839H16.064Z" fill="#FFC477"/>
<path d="M17.4668 13.2839V15.9697C18.2395 15.9686 18.8655 15.3439 18.8655 14.5733V13.284H17.4668V13.2839Z" fill="#FF9F22"/>
<path d="M12.5122 11.017V13.7057H17.4664L17.8896 12.3614L17.4664 11.017H12.5122Z" fill="#FFEB99"/>
<path d="M17.4668 11.0171H22.417V13.7059H17.4668V11.0171Z" fill="#FFC477"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,21 @@
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.66415 8.76531C6.92473 8.32745 5.0903 8.35652 3.35916 8.84931C2.49635 9.09463 1.67052 9.45099 0.904693 9.90831C0.754212 9.9982 0.705081 10.193 0.794921 10.3435C0.880234 10.4865 1.08674 10.5388 1.23016 10.4533C1.94846 10.0243 2.72317 9.69004 3.53283 9.45983C5.15699 8.99743 6.87775 8.97009 8.50919 9.38087C8.67922 9.42352 8.85166 9.32052 8.89445 9.15057C8.93723 8.98063 8.8341 8.8081 8.66415 8.76531Z" fill="#6BBEF6"/>
<path d="M8.12225 10.7249C6.74155 10.3868 5.28693 10.4145 3.91562 10.8051C3.22009 11.0029 2.55528 11.29 1.9396 11.6585C1.7892 11.7485 1.74024 11.9434 1.83025 12.0938C1.8897 12.1932 1.99495 12.2483 2.1029 12.2483C2.15838 12.2483 2.21453 12.2337 2.26557 12.2032C2.8336 11.8632 3.44716 11.5983 4.08942 11.4156C5.35502 11.0551 6.69733 11.0295 7.97126 11.3415C8.14138 11.3831 8.31332 11.279 8.35504 11.1087C8.39677 10.9385 8.29254 10.7667 8.12225 10.7249Z" fill="#6BBEF6"/>
<path d="M7.58129 12.686C6.56068 12.4464 5.48585 12.472 4.47314 12.7604C3.94616 12.9102 3.44241 13.1284 2.97577 13.4087C2.8255 13.499 2.77688 13.694 2.86714 13.8442C2.95648 13.9929 3.15431 14.0419 3.30264 13.9528C3.72137 13.7013 4.17358 13.5055 4.64686 13.3709C5.55597 13.1121 6.52047 13.0889 7.43614 13.304C7.6069 13.3437 7.77761 13.2382 7.81768 13.0676C7.85776 12.897 7.75192 12.7261 7.58129 12.686Z" fill="#6BBEF6"/>
<path d="M15.2237 19.9248L14.4248 21.7359C14.3227 21.9674 14.0935 22.1168 13.8406 22.1168H8.87661C8.54776 22.1168 8.32741 21.7788 8.46012 21.4779L10.1353 17.6802L14.0645 19.4135L15.2237 19.9248Z" fill="#FFDDCE"/>
<path d="M15.224 19.9247L14.4251 21.7358C14.323 21.9673 14.0938 22.1167 13.8408 22.1167H12.8721L14.0648 19.4133L15.224 19.9247Z" fill="#FFCBBE"/>
<path d="M14.9355 13.7081L17.0503 14.6411L19.9865 7.98534C20.2438 7.4022 19.979 6.72063 19.395 6.463C18.811 6.20537 18.1291 6.46926 17.8718 7.0524L14.9355 13.7081Z" fill="#FFDDCE"/>
<path d="M19.3948 6.46288C19.2102 6.38142 19.0158 6.35226 18.8281 6.36864C19.0756 6.69241 19.1439 7.13717 18.968 7.53593L16.6171 12.8646C16.4019 13.3525 16.6226 13.9224 17.1102 14.1375L17.2457 14.1973L19.9863 7.98522C20.2436 7.40208 19.9787 6.72047 19.3948 6.46288Z" fill="#FFCBBE"/>
<path d="M12.8218 12.7752L14.9365 13.7082L17.5212 7.84953C17.7786 7.26596 17.5142 6.58423 16.9307 6.32677L16.9292 6.32609C16.3457 6.06863 15.6639 6.33303 15.4065 6.91655L12.8218 12.7752Z" fill="#FFDDCE"/>
<path d="M16.9308 6.327L16.9289 6.32615C16.7446 6.24486 16.5506 6.21574 16.3632 6.2322C16.6106 6.55606 16.6788 7.00129 16.5026 7.40064L14.507 11.9239C14.2898 12.4163 14.5126 12.9914 15.0046 13.2084L15.1321 13.2646L17.5208 7.85014C17.7784 7.26632 17.5142 6.58441 16.9308 6.327Z" fill="#FFCBBE"/>
<path d="M9.31333 14.9826C8.69401 16.3864 9.33203 18.028 10.739 18.6487L14.5117 20.313C15.6924 20.8339 17.0713 20.3007 17.5912 19.1223L21.8645 9.43582C21.9931 9.14446 21.9912 8.82877 21.884 8.55303C21.7767 8.27733 21.5647 8.04289 21.2727 7.91411C20.6889 7.65657 20.0069 7.92025 19.7499 8.50292L17.2391 14.1943L13.0098 12.3285C13.0447 12.2507 14.8624 8.13027 14.8624 8.13027C14.991 7.83892 14.9888 7.52259 14.8819 7.24748C14.7751 6.97195 14.5626 6.73734 14.2706 6.60857C13.6868 6.35103 13.005 6.61424 12.7478 7.19738L9.31333 14.9826Z" fill="#FFDDCE"/>
<path d="M13.8708 6.80125C13.9778 7.07631 13.9799 7.39268 13.8513 7.68403C13.8513 7.68403 12.8387 9.9793 12.3106 11.176C12.1384 11.5663 12.3151 12.0219 12.7051 12.194L13.0171 12.3316C13.052 12.2537 14.8697 8.13332 14.8697 8.13332C14.9983 7.84196 14.9961 7.52564 14.8892 7.25053C14.7824 6.975 14.5699 6.74039 14.278 6.61162C14.0934 6.5302 13.899 6.50096 13.7113 6.51729C13.7778 6.60426 13.8316 6.69994 13.8708 6.80125Z" fill="#FFCBBE"/>
<path d="M21.8916 8.55589C21.7844 8.28019 21.5723 8.04575 21.2803 7.91698C21.0957 7.83556 20.9013 7.80636 20.7136 7.82274C20.7801 7.9097 20.8337 8.00534 20.8731 8.1066C20.9804 8.3823 20.9822 8.69803 20.8537 8.98939L18.0015 15.4545C17.852 15.7934 17.4731 15.9692 17.1189 15.8608C15.9254 15.4954 14.1424 15.4075 13.3147 17.2839C12.4318 19.285 14.0807 20.1199 14.0807 20.1199L14.5193 20.3159C15.6999 20.8367 17.0789 20.3035 17.5988 19.1252L21.8721 9.43868C22.0007 9.14732 21.9988 8.83159 21.8916 8.55589Z" fill="#FFCBBE"/>
<path d="M14.8254 17.0158C15.5801 16.487 16.0509 16.4862 17.0073 16.5379C17.3379 16.5557 17.8815 16.4211 18.0859 16.1609L20.1141 13.0931C20.5543 12.5328 21.366 12.4359 21.9258 12.8767C22.4848 13.3169 22.5808 14.1266 22.1401 14.6852L19.6237 18.5358C19.6237 18.5358 18.6772 19.939 17.6984 20.3716C16.3168 20.9823 14.669 20.6074 13.7762 19.8554C13.7762 19.8554 13.6378 19.6408 13.8425 18.5751C13.9737 17.8921 14.8254 17.0158 14.8254 17.0158Z" fill="#FFDDCE"/>
<path d="M21.9254 12.8765C21.6236 12.6388 21.2486 12.5577 20.8981 12.621C21.2849 13.0786 21.3102 13.7596 20.9246 14.2483L18.4082 18.099C18.4082 18.099 17.4617 19.5021 16.4829 19.9347C15.756 20.2561 14.9555 20.3043 14.23 20.1685C15.1617 20.6979 16.5256 20.8896 17.698 20.3713C18.6768 19.9387 19.6232 18.5355 19.6232 18.5355L22.1397 14.6849C22.5803 14.1264 22.4844 13.3167 21.9254 12.8765Z" fill="#FFCBBE"/>
<path d="M14.9833 4.37348H8.18247C7.09901 4.37348 6.2207 3.49518 6.2207 2.41172C6.2207 1.32826 7.09901 0.449951 8.18247 0.449951H14.9833C16.0667 0.449951 16.945 1.32826 16.945 2.41172C16.945 3.49518 16.0667 4.37348 14.9833 4.37348Z" fill="#5C90B9"/>
<path d="M14.9836 0.449951H13.6758C14.7592 0.449951 15.6375 1.32826 15.6375 2.41172C15.6375 3.49518 14.7592 4.37348 13.6758 4.37348H14.9836C16.0671 4.37348 16.9454 3.49518 16.9454 2.41172C16.9454 1.32826 16.0671 0.449951 14.9836 0.449951Z" fill="#4A80AA"/>
<path d="M11.5833 4.37348C12.6695 4.37348 13.55 3.49517 13.55 2.41172C13.55 1.32826 12.6695 0.449951 11.5833 0.449951C10.4972 0.449951 9.6167 1.32826 9.6167 2.41172C9.6167 3.49517 10.4972 4.37348 11.5833 4.37348Z" fill="#FFD064"/>
<path d="M11.5829 4.37348C12.6663 4.37348 13.5446 3.49517 13.5446 2.41172C13.5446 1.32826 12.6663 0.449951 11.5829 0.449951C10.4994 0.449951 9.62109 1.32826 9.62109 2.41172C9.62109 3.49517 10.4994 4.37348 11.5829 4.37348Z" fill="#FFD064"/>
<path d="M11.584 3.06649C11.9454 3.06649 12.2384 2.77353 12.2384 2.41215C12.2384 2.05077 11.9454 1.75781 11.584 1.75781C11.2226 1.75781 10.9297 2.05077 10.9297 2.41215C10.9297 2.77353 11.2226 3.06649 11.584 3.06649Z" fill="#5C90B9"/>
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -0,0 +1,6 @@
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.5834 22.3166C8.68969 22.3166 5.96921 21.1897 3.92302 19.1435C1.87688 17.0974 0.75 14.3769 0.75 11.4833C0.75 8.58959 1.87688 5.86911 3.92298 3.82293C5.96921 1.77678 8.68961 0.649902 11.5834 0.649902C14.477 0.649902 17.1975 1.77678 19.2436 3.82293C21.2898 5.86911 22.4167 8.58955 22.4167 11.4833C22.4167 14.377 21.2897 17.0974 19.2436 19.1436C17.1975 21.1898 14.477 22.3166 11.5834 22.3166ZM11.5834 3.60368C7.23853 3.60368 3.70378 7.13843 3.70378 11.4833C3.70378 15.8281 7.23853 19.3628 11.5834 19.3628C15.9282 19.3628 19.463 15.8281 19.463 11.4833C19.463 7.13848 15.9281 3.60368 11.5834 3.60368Z" fill="#7DD2F0"/>
<g opacity="0.1">
<path d="M5.89215 19.1435C3.84605 17.0974 2.71917 14.3769 2.71917 11.4832C2.71917 8.58955 3.84605 5.86907 5.89215 3.82297C7.70445 2.01067 10.0458 0.920313 12.5679 0.694548C12.2424 0.665348 11.9141 0.649902 11.5834 0.649902C8.68969 0.649902 5.96921 1.77678 3.92302 3.82293C1.87688 5.86903 0.75 8.58955 0.75 11.4832C0.75 14.3768 1.87688 17.0974 3.92298 19.1435C5.96913 21.1896 8.68961 22.3166 11.5833 22.3166C11.914 22.3166 12.2424 22.3011 12.5679 22.272C10.0458 22.0462 7.70449 20.9558 5.89215 19.1435Z" fill="black"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 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,6 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18.3711 7.19528L16.5547 0.0468445L15.1602 1.4296C13.6133 0.492096 11.8164 0 10 0C4.65622 0 0.257721 4.22272 0.0234985 9.55475L0 10.0468L3.52737 10.8086L3.51563 10.0821C3.48038 6.46088 6.43753 3.51562 10 3.51562C10.8789 3.51562 11.7616 3.69141 12.5703 4.03122L11.2227 5.37888L18.3711 7.19528Z" fill="#EBEBEB"/>
<path d="M16.4843 9.27338V10C16.4843 13.586 13.5038 16.4844 9.99997 16.4844C9.13281 16.4844 8.2774 16.3086 7.48044 15.9688L8.78125 14.6797L1.59375 12.8398L3.4335 19.9883L4.83975 18.582C6.38669 19.5078 8.19531 20 9.99997 20C15.332 20 19.7305 15.8008 19.9765 10.4805L20 9.98825C19.7656 9.94141 16.6015 9.29687 16.4843 9.27338Z" fill="#EBEBEB"/>
<path d="M12.5703 4.03122C11.7616 3.69141 10.8789 3.51562 10 3.51562V0C11.8164 0 13.6133 0.492096 15.1602 1.4296L16.5547 0.0468445L18.3711 7.19528L11.2227 5.37888L12.5703 4.03122Z" fill="#D8D8D8"/>
<path d="M20 9.98825L19.9765 10.4805C19.7305 15.8008 15.332 20 10 20V16.4844C13.5039 16.4844 16.4844 13.586 16.4844 10V9.27338C16.6016 9.29687 19.7656 9.94141 20 9.98825Z" fill="#D8D8D8"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,10 @@
<svg width="27" height="22" viewBox="0 0 27 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22.1479 19.7489C21.8971 19.7489 21.6463 19.6536 21.455 19.4628C21.0723 19.0813 21.0723 18.4628 21.455 18.0813C23.3489 16.1931 24.392 13.6783 24.392 11C24.392 8.32175 23.3489 5.8069 21.455 3.91875C21.0723 3.53726 21.0723 2.9187 21.455 2.53721C21.8376 2.15573 22.4581 2.15573 22.8407 2.53721C25.1049 4.79436 26.3518 7.79982 26.3518 11C26.3518 14.2001 25.1049 17.2056 22.8407 19.4628C22.6495 19.6535 22.3986 19.7489 22.1479 19.7489Z" fill="#8ABBD5"/>
<path d="M19.1532 16.7632C18.9024 16.7632 18.6517 16.6678 18.4603 16.4771C18.0777 16.0956 18.0777 15.477 18.4603 15.0955C19.5576 14.0016 20.162 12.5471 20.162 11.0001C20.162 9.453 19.5577 7.99856 18.4603 6.90459C18.0777 6.5231 18.0777 5.90454 18.4603 5.52305C18.843 5.14157 19.4635 5.14157 19.8461 5.52305C21.3136 6.98602 22.1218 8.93113 22.1218 11.0001C22.1218 13.069 21.3136 15.0141 19.8461 16.4771C19.6548 16.6678 19.404 16.7632 19.1532 16.7632Z" fill="#8ABBD5"/>
<path d="M6.82209 16.5777H2.98238C1.65778 16.5777 0.583984 15.5072 0.583984 14.1867V7.81316C0.583984 6.49264 1.65778 5.42215 2.98238 5.42215H6.82209L7.45701 11L6.82209 16.5777Z" fill="#7A8C98"/>
<path d="M7.45702 10.9997L6.82195 16.5776H2.98245C1.65735 16.5776 0.583496 15.5071 0.583496 14.1866V12.4841C0.583496 13.0991 1.65735 13.5979 2.98245 13.5979H6.82195L7.45702 10.9997Z" fill="#596C76"/>
<path d="M11.7625 15.2926C14.1406 15.2926 16.0685 13.3707 16.0685 10.9999C16.0685 8.62907 14.1406 6.70715 11.7625 6.70715C9.38439 6.70715 7.45654 8.62907 7.45654 10.9999C7.45654 13.3707 9.38439 15.2926 11.7625 15.2926Z" fill="#7A8C98"/>
<path d="M16.0691 10.9998C16.0691 13.3706 14.1413 15.2923 11.7633 15.2923C9.38527 15.2923 7.45752 13.3705 7.45752 10.9998C7.45752 10.5114 7.53946 10.0428 7.6901 9.60535C8.27015 11.2914 9.87459 12.5034 11.7633 12.5034C13.652 12.5034 15.2564 11.2914 15.8365 9.60535C15.9871 10.0428 16.0691 10.5115 16.0691 10.9998Z" fill="#596C76"/>
<path d="M10.7297 21.1156L6.82178 16.5777V5.42208L10.7297 0.884102C11.9129 -0.489855 14.1721 0.344314 14.1721 2.15515V19.8446C14.1721 21.6554 11.9129 22.4895 10.7297 21.1156Z" fill="#E8E8E8"/>
<path d="M14.173 15.1207V19.8452C14.173 21.6557 11.9137 22.49 10.7305 21.1158L6.82275 16.5782V13.5985L10.7305 15.7127C11.9137 16.3524 14.173 15.9638 14.173 15.1207Z" fill="#C8C8C8"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -11,38 +11,37 @@ part 'scene_state.dart';
class SceneBloc extends Bloc<SceneEvent, SceneState> {
SceneBloc() : super(SceneInitial()) {
on<LoadScenes>(_onLoadScenes);
on<SceneTrigger>(_sceneTrigger);
on<SceneTrigger>(_onSceneTrigger);
}
FutureOr<void> _onLoadScenes(
LoadScenes event, Emitter<SceneState> emit) async {
Future<void> _onLoadScenes(LoadScenes event, Emitter<SceneState> emit) async {
emit(SceneLoading());
try {
final scenes = await SceneApi.getScenesByUnitId(event.unitId);
if (scenes.isNotEmpty) {
emit(SceneLoaded(scenes));
} else {
emit(SceneTriggerError(message: 'Something went wrong'));
}
emit(SceneLoaded(scenes));
} catch (e) {
emit(SceneError(message: e.toString()));
}
}
FutureOr<void> _sceneTrigger(
Future<void> _onSceneTrigger(
SceneTrigger event, Emitter<SceneState> emit) async {
emit(SceneTriggerLoading());
final currentState = state;
if (currentState is SceneLoaded) {
emit(SceneLoaded(currentState.scenes, loadingSceneId: event.sceneId));
try {
final success = await SceneApi.triggerScene(event.sceneId);
if (success) {
emit(SceneTriggerState(success: true));
} else {
emit(SceneTriggerError(message: 'Something went wrong'));
try {
final success = await SceneApi.triggerScene(event.sceneId);
if (success) {
emit(SceneTriggerSuccess(event.name));
emit(SceneLoaded(currentState.scenes));
} else {
emit(const SceneError(message: 'Something went wrong'));
}
} catch (e) {
emit(SceneError(message: e.toString()));
}
} catch (e) {
emit(SceneTriggerError(message: e.toString()));
}
}
}

View File

@ -1,6 +1,8 @@
import 'package:equatable/equatable.dart';
abstract class SceneEvent extends Equatable {
const SceneEvent();
@override
List<Object> get props => [];
}
@ -8,7 +10,7 @@ abstract class SceneEvent extends Equatable {
class LoadScenes extends SceneEvent {
final String unitId;
LoadScenes(this.unitId);
const LoadScenes(this.unitId);
@override
List<Object> get props => [unitId];
@ -16,8 +18,9 @@ class LoadScenes extends SceneEvent {
class SceneTrigger extends SceneEvent {
final String sceneId;
final String name;
SceneTrigger(this.sceneId);
const SceneTrigger(this.sceneId, this.name);
@override
List<Object> get props => [sceneId];

View File

@ -1,8 +1,10 @@
part of 'scene_bloc.dart';
abstract class SceneState extends Equatable {
const SceneState();
@override
List<Object> get props => [];
List<Object?> get props => [];
}
class SceneInitial extends SceneState {}
@ -11,38 +13,28 @@ class SceneLoading extends SceneState {}
class SceneLoaded extends SceneState {
final List<SceneModel> scenes;
final String? loadingSceneId;
SceneLoaded(this.scenes);
const SceneLoaded(this.scenes, {this.loadingSceneId});
@override
List<Object> get props => [scenes];
List<Object?> get props => [scenes, loadingSceneId];
}
class SceneError extends SceneState {
final String message;
SceneError({required this.message});
const SceneError({required this.message});
@override
List<Object> get props => [message];
}
class SceneTriggerState extends SceneState {
final bool success;
class SceneTriggerSuccess extends SceneState {
final String sceneName;
SceneTriggerState({required this.success});
const SceneTriggerSuccess(this.sceneName);
@override
List<Object> get props => [success];
}
class SceneTriggerLoading extends SceneState {}
class SceneTriggerError extends SceneState {
final String message;
SceneTriggerError({required this.message});
@override
List<Object> get props => [message];
List<Object> get props => [sceneName];
}

View File

@ -145,14 +145,182 @@ List<SceneStaticFunction> doorLockFunctions(
{required List<FunctionModel> functions,
required String deviceId,
required String deviceName}) {
return [];
return [
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIconsDoorLock,
operationName: 'Set Door lock Normal Open',
code: 'normal_open_switch',
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
];
}
List<SceneStaticFunction> wallSensorFunctions(
{required List<FunctionModel> functions,
required String deviceId,
required String deviceName}) {
return [];
return [
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFarDetection,
operationName: 'Far Detection',
code: 'far_detection',
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 75,
description: '75cm',
iconValue: '75',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 150,
description: '150cm',
iconValue: '150',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 225,
description: '225cm',
iconValue: '225',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 300,
description: '300cm',
iconValue: '300',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 375,
description: '375cm',
iconValue: '375',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 450,
description: '450cm',
iconValue: '450',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 525,
description: '525cm',
iconValue: '525',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 600,
description: '600cm',
iconValue: '600',
),
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsMotionDetection,
operationName: 'Motion Detection Sensitivity',
code: 'motion_sensitivity_value',
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(),
),
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsMotionlessDetection,
operationName: 'Motionless Detection Sensitivity',
code: 'motionless_sensitivity',
operationalValues: [
SceneOperationalValue(
iconValue: '1',
icon: Assets.assetsFarDetectionFunction,
value: 1,
description: '1',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 2,
description: '2',
iconValue: '2',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 3,
description: '3',
iconValue: '3',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 4,
description: '4',
iconValue: '4',
),
SceneOperationalValue(
icon: Assets.assetsFarDetectionFunction,
value: 5,
description: '5',
iconValue: '5',
),
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsIndicator,
operationName: 'Indicator',
code: 'indicator',
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsNobodyTime,
operationName: 'Nobody Time',
code: 'presence_time',
operationalValues: [
SceneOperationalValue(icon: '', value: 0),
],
),
];
}
List<SceneStaticFunction> lightBulbFunctions(
@ -166,7 +334,53 @@ List<SceneStaticFunction> gatewayFunctions(
{required List<FunctionModel> functions,
required String deviceId,
required String deviceName}) {
return [];
return [
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsSwitchAlarmSound,
operationName: 'Switch Alarm Sound',
code: 'switch_alarm_sound',
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsMasterState,
operationName: 'Master State',
code: 'master_state',
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsAcPower,
description: "Alarm",
value: 'alarm',
),
SceneOperationalValue(
icon: Assets.assetsAcPowerOFF,
description: "Normal",
value: 'normal',
),
],
),
SceneStaticFunction(
deviceId: deviceId,
deviceName: deviceName,
icon: Assets.assetsFactoryReset,
operationName: 'Factory Reset',
code: 'factory_reset',
operationalValues: [
SceneOperationalValue(
icon: Assets.assetsSceneRefresh, description: "ON", value: true),
SceneOperationalValue(
icon: Assets.assetsResetOff, description: "OFF", value: false),
],
),
];
}
List<SceneStaticFunction> threeGangFunctions(

View File

@ -101,27 +101,36 @@ class SceneOperationalValue {
final String icon;
final dynamic value;
final String? description;
final String? iconValue;
SceneOperationalValue({
required this.icon,
required this.value,
this.description,
this.iconValue,
});
SceneOperationalValue copyWith({
String? icon,
dynamic value,
String? description,
String? iconValue,
}) {
return SceneOperationalValue(
icon: icon ?? this.icon,
value: value ?? this.value,
description: description ?? this.description,
iconValue: iconValue ?? this.iconValue,
);
}
Map<String, dynamic> toMap() {
return {'icon': icon, 'value': value, 'description': description};
return {
'icon': icon,
'value': value,
'description': description,
'iconValue': iconValue
};
}
factory SceneOperationalValue.fromMap(Map<String, dynamic> map) {
@ -129,6 +138,7 @@ class SceneOperationalValue {
icon: map['icon'] ?? '',
value: map['value'],
description: map['description'],
iconValue: map['iconValue'] ?? '',
);
}
@ -139,7 +149,7 @@ class SceneOperationalValue {
@override
String toString() =>
'StaticFunctionOperationHelper(icon: $icon, value: $value, description: $description)';
'StaticFunctionOperationHelper(icon: $icon, value: $value, description: $description, iconValue: $iconValue)';
@override
bool operator ==(Object other) {
@ -148,9 +158,15 @@ class SceneOperationalValue {
return other is SceneOperationalValue &&
other.icon == icon &&
other.description == description &&
other.iconValue == iconValue &&
other.value == value;
}
@override
int get hashCode => icon.hashCode ^ value.hashCode ^ description.hashCode;
int get hashCode =>
icon.hashCode ^
value.hashCode ^
description.hashCode ^
iconValue.hashCode ^
description.hashCode;
}

View File

@ -97,7 +97,7 @@ class DeviceFunctionsView extends StatelessWidget
BlocBuilder<CreateSceneBloc, CreateSceneState>(
builder: (context, state) {
return SceneListTile(
iconsSize: 32,
iconsSize: 22,
minLeadingWidth: 20,
assetPath: functions[index].icon,
titleString: functions[index].operationName,
@ -118,7 +118,12 @@ class DeviceFunctionsView extends StatelessWidget
alertBody: functions[index].code == 'temp_set'
? AlertDialogTemperatureBody(
index: index, functions: functions)
: functions[index].code.contains('countdown')
: (functions[index]
.code
.contains('countdown') ||
functions[index]
.code
.contains('presence_time'))
? AlertDialogCountdown(
durationValue: functions[index]
.operationalValues

View File

@ -3,14 +3,11 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_grid_view.dart';
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_header.dart';
import 'package:syncrow_app/features/shared_widgets/create_unit.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
import 'package:syncrow_app/utils/context_extension.dart';
class SceneView extends StatelessWidget {
const SceneView({super.key});
@ -20,113 +17,48 @@ class SceneView extends StatelessWidget {
return BlocProvider(
create: (BuildContext context) => SceneBloc()
..add(LoadScenes(HomeCubit.getInstance().selectedSpace!.id!)),
child: HomeCubit.getInstance().spaces?.isEmpty ?? true
? const CreateUnitWidget()
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const TitleMedium(
text: StringsManager.routine,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 20),
const BodySmall(
text: StringsManager.tapToRunRoutine,
),
const SizedBox(height: 8),
BlocBuilder<SceneBloc, SceneState>(
builder: (context, state) {
if (state is SceneLoading) {
return const Center(
child: CircularProgressIndicator(),
);
}
if (state is SceneError) {
return Center(
child: Text(state.message),
);
}
if (state is SceneLoaded) {
return Expanded(
child: GridView.builder(
shrinkWrap: true,
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 12,
crossAxisSpacing: 12,
childAspectRatio: 1.5,
child: BlocListener<SceneBloc, SceneState>(
listener: (context, state) {
if (state is SceneTriggerSuccess) {
context.showCustomSnackbar(
message: 'Scene ${state.sceneName} triggered successfully!');
}
},
child: HomeCubit.getInstance().spaces?.isEmpty ?? true
? const CreateUnitWidget()
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SceneHeader(),
const SizedBox(height: 8),
BlocBuilder<SceneBloc, SceneState>(
builder: (context, state) {
if (state is SceneLoading) {
return const Center(
child: CircularProgressIndicator(),
);
}
if (state is SceneError) {
return Center(
child: Text(state.message),
);
}
if (state is SceneLoaded) {
return Expanded(
child: SceneGrid(
scenes: state.scenes,
loadingSceneId: state.loadingSceneId,
),
itemCount: state.scenes.length,
itemBuilder: (context, index) {
final scene = state.scenes[index];
return DefaultContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Image.asset(
height: 32,
width: 32,
Assets.assetsIconsLogo,
fit: BoxFit.fill,
),
BlocBuilder<SceneBloc, SceneState>(
builder: (context, state) {
return IconButton(
padding: EdgeInsets.zero,
onPressed: () {
// context
// .read<SceneBloc>()
// .add(SceneTrigger(scene.id));
},
icon: state is SceneTriggerLoading
? const Center(
child:
CircularProgressIndicator())
: const Icon(
Icons.play_circle,
size: 40,
color:
ColorsManager.greyColor,
),
);
},
)
],
),
const SizedBox(
height: 10,
),
BodyMedium(
text: scene.name,
maxLines: 1,
overflow: TextOverflow.fade,
fontWeight: FontWeight.bold,
fontSize: 16,
)
],
),
);
},
),
);
}
);
}
return const SizedBox();
},
),
],
),
return const SizedBox();
},
),
],
),
),
);
}
}

View File

@ -36,6 +36,7 @@ class _AlertDialogFunctionsOperationsBodyState
minLeadingWidth: 15,
padding: const EdgeInsets.symmetric(horizontal: 16),
assetPath: operation.icon,
assetHeaderValue: operation.iconValue,
titleString: operation.description.toString(),
textAlign: TextAlign.start,
trailingWidget: Radio(

View File

@ -22,6 +22,7 @@ class SceneListTile extends StatelessWidget {
this.subtitleString,
this.subtitleWidget,
this.iconsSize,
this.assetHeaderValue,
});
final String? assetPath;
final String? titleString;
@ -36,6 +37,7 @@ class SceneListTile extends StatelessWidget {
final double? minLeadingWidth;
final Widget? titleWidget;
final double? iconsSize;
final String? assetHeaderValue;
@override
Widget build(BuildContext context) {
@ -50,7 +52,7 @@ class SceneListTile extends StatelessWidget {
width: iconsSize,
height: assetHeight ?? 35,
alignment: Alignment.center,
fit: BoxFit.contain,
fit: BoxFit.fitWidth,
),
)
: null),

View File

@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/scene/model/scene_model.dart';
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_item.dart';
class SceneGrid extends StatelessWidget {
final List<SceneModel> scenes;
final String? loadingSceneId;
const SceneGrid({
required this.scenes,
required this.loadingSceneId,
super.key,
});
@override
Widget build(BuildContext context) {
return GridView.builder(
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 12,
crossAxisSpacing: 12,
childAspectRatio: 1.5,
),
itemCount: scenes.length,
itemBuilder: (context, index) {
final scene = scenes[index];
final isLoading = loadingSceneId == scene.id;
return SceneItem(scene: scene, isLoading: isLoading);
},
);
}
}

View File

@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
class SceneHeader extends StatelessWidget {
const SceneHeader({super.key});
@override
Widget build(BuildContext context) {
return const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TitleMedium(
text: StringsManager.routine,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 20),
BodySmall(
text: StringsManager.tapToRunRoutine,
),
],
);
}
}

View File

@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
import 'package:syncrow_app/features/scene/model/scene_model.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class SceneItem extends StatelessWidget {
final SceneModel scene;
final bool isLoading;
const SceneItem({
required this.scene,
required this.isLoading,
super.key,
});
@override
Widget build(BuildContext context) {
return DefaultContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset(
height: 32,
width: 32,
Assets.assetsIconsLogo,
fit: BoxFit.fill,
),
IconButton(
padding: EdgeInsets.zero,
onPressed: () {
context
.read<SceneBloc>()
.add(SceneTrigger(scene.id, scene.name));
},
icon: isLoading
? const Center(
child: CircularProgressIndicator(),
)
: const Icon(
Icons.play_circle,
size: 40,
color: ColorsManager.greyColor,
),
),
],
),
const SizedBox(height: 10),
BodyMedium(
text: scene.name,
maxLines: 1,
overflow: TextOverflow.fade,
fontWeight: FontWeight.bold,
fontSize: 16,
),
],
),
);
}
}

View File

@ -853,8 +853,58 @@ class Assets {
static const String assetsSceneRefresh =
"assets/icons/functions_icons/scene_refresh.svg";
//assets/icons/functions_icons/light_countdown.svg
//assets/icons/functions_icons/light_countdown.svg
static const String assetsLightCountdown =
"assets/icons/functions_icons/light_countdown.svg";
//assets/icons/functions_icons/far_detection.svg
static const String assetsFarDetection =
"assets/icons/functions_icons/far_detection.svg";
//assets/icons/functions_icons/far_detection_function.svg
static const String assetsFarDetectionFunction =
"assets/icons/functions_icons/far_detection_function.svg";
//assets/icons/functions_icons/indicator.svg
static const String assetsIndicator =
"assets/icons/functions_icons/indicator.svg";
//assets/icons/functions_icons/motion_detection.svg
static const String assetsMotionDetection =
"assets/icons/functions_icons/motion_detection.svg";
//assets/icons/functions_icons/motionless_detection.svg
static const String assetsMotionlessDetection =
"assets/icons/functions_icons/motionless_detection.svg";
//assets/icons/functions_icons/nobody_time.svg
static const String assetsNobodyTime =
"assets/icons/functions_icons/nobody_time.svg";
//assets/icons/functions_icons/factory_reset.svg
static const String assetsFactoryReset =
"assets/icons/functions_icons/factory_reset.svg";
//assets/icons/functions_icons/master_state.svg
static const String assetsMasterState =
"assets/icons/functions_icons/master_state.svg";
//assets/icons/functions_icons/switch_alarm_sound.svg
static const String assetsSwitchAlarmSound =
"assets/icons/functions_icons/switch_alarm_sound.svg";
//assets/icons/functions_icons/reset_off.svg
static const String assetsResetOff =
"assets/icons/functions_icons/reset_off.svg";
}

View File

@ -45,7 +45,7 @@ class SceneApi {
static Future<bool> triggerScene(String sceneId) async {
try {
final response = await _httpService.post(
path: ApiEndpoints.triggerScene.replaceAll('{sceneUuid}', sceneId),
path: ApiEndpoints.triggerScene.replaceAll('{sceneId}', sceneId),
showServerMessage: false,
expectedResponseModel: (json) => json['success'],
);