Esempio n. 1
0
    def test_change_ip_address__shoudl_call_sdk_function(self):
        self.sdk.modify_ip_address.return_value = None

        ZKAccess.change_ip('00:17:61:01:88:27', '192.168.1.100',
                           '255.255.255.0', ChangeIPProtocol.udp, 'path')

        self.sdk.modify_ip_address.assert_called_once_with(
            '00:17:61:01:88:27', '192.168.1.100', '255.255.255.0', 'UDP')
Esempio n. 2
0
    def change_ip(
            self, mac_address: str, new_ip: str, *, broadcast_address: str = '255.255.255.255'
    ):
        """
        Classmethod that changes IP address on a device without
        making a connection to it -- by sending broadcast packets to
        the given broadcast address. For security reasons, network
        settings can be changed by this command on devices with
        no password only.

        Args:
            mac_address: MAC address of a device
            new_ip: new IP address to be set on a device
            broadcast_address: broadcast network address to send
                broadcast packets to
        """
        ZKAccess.change_ip(
            mac_address, new_ip, broadcast_address, ChangeIPProtocol.udp, self._dllpath
        )