|
19 | 19 |
|
20 | 20 | from chip.ChipDeviceCtrl import ChipDeviceController |
21 | 21 | from chip.clusters import Attribute, Objects as Clusters |
22 | | -from chip.clusters.Attribute import SubscriptionTransaction, ValueDecodeFailure |
| 22 | +from chip.clusters.Attribute import AttributeWriteResult, ValueDecodeFailure |
23 | 23 | from chip.clusters.ClusterObjects import ALL_ATTRIBUTES, ALL_CLUSTERS, Cluster |
24 | 24 | from chip.discovery import DiscoveryType |
25 | 25 | from chip.exceptions import ChipStackError |
@@ -862,53 +862,19 @@ async def set_acl_entry( |
862 | 862 | self, |
863 | 863 | node_id: int, |
864 | 864 | entry: list[Clusters.AccessControl.Structs.AccessControlEntryStruct], |
865 | | - ): |
| 865 | + ) -> list[AttributeWriteResult] | None: |
866 | 866 | """Set acl entry""" |
867 | 867 | return await self._chip_device_controller.write_attribute( |
868 | 868 | node_id, [(0, Clusters.AccessControl.Attributes.Acl(entry))] |
869 | 869 | ) |
870 | 870 |
|
871 | | - @api_command(APICommand.GET_ACL_ENTRY) |
872 | | - async def get_acl_entry(self, node_id: int): |
873 | | - """Get acl entry""" |
874 | | - read_response: ( |
875 | | - SubscriptionTransaction | Attribute.AsyncReadTransaction.ReadResponse | None |
876 | | - ) = await self._chip_device_controller.read_attribute( |
877 | | - node_id, [(0, Clusters.AccessControl.Attributes.Acl)] |
878 | | - ) |
879 | | - acl_entities = [] |
880 | | - if isinstance(read_response, Attribute.AsyncReadTransaction.ReadResponse): |
881 | | - acl_entities: list[ |
882 | | - Clusters.AccessControl.Structs.AccessControlEntryStruct |
883 | | - ] = read_response.attributes[0][Clusters.AccessControl][ |
884 | | - Clusters.AccessControl.Attributes.Acl |
885 | | - ] |
886 | | - return acl_entities |
887 | | - |
888 | | - @api_command(APICommand.GET_NODE_BINDINGS) |
889 | | - async def get_node_bindings(self, node_id: int): |
890 | | - """Get node bindings""" |
891 | | - read_response: ( |
892 | | - SubscriptionTransaction | Attribute.AsyncReadTransaction.ReadResponse | None |
893 | | - ) = await self._chip_device_controller.read_attribute( |
894 | | - node_id, (Clusters.Binding.Attributes.Binding,) |
895 | | - ) |
896 | | - |
897 | | - bindings = [] |
898 | | - if isinstance(read_response, Attribute.AsyncReadTransaction.ReadResponse): |
899 | | - for k, v in read_response.attributes.items(): |
900 | | - bindings.append( |
901 | | - {k: v[Clusters.Binding][Clusters.Binding.Attributes.Binding]} |
902 | | - ) |
903 | | - return bindings |
904 | | - |
905 | 871 | @api_command(APICommand.SET_NODE_BINDING) |
906 | 872 | async def set_node_binding( |
907 | 873 | self, |
908 | 874 | node_id: int, |
909 | 875 | endpoint: int, |
910 | 876 | bindings: list[Clusters.Binding.Structs.TargetStruct], |
911 | | - ): |
| 877 | + ) -> list[AttributeWriteResult] | None: |
912 | 878 | """Set node binding""" |
913 | 879 | return await self._chip_device_controller.write_attribute( |
914 | 880 | node_id, [(endpoint, Clusters.Binding.Attributes.Binding(bindings))] |
|
0 commit comments