pyg90alarm.local.host_info
Protocol entity for G90 alarm panel information.
Classes
|
Interprets data fields of GETHOSTINFO command. |
- enum pyg90alarm.local.host_info.G90HostInfoGsmStatus(value)
Bases:
IntEnumDefines possible values of GSM module status.
- Member Type:
Valid values are as follows:
- POWERED_OFF = <G90HostInfoGsmStatus.POWERED_OFF: 0>
- SIM_ABSENT = <G90HostInfoGsmStatus.SIM_ABSENT: 1>
- NO_SIGNAL = <G90HostInfoGsmStatus.NO_SIGNAL: 2>
- OPERATIONAL = <G90HostInfoGsmStatus.OPERATIONAL: 3>
The
Enumand its members also have the following methods:- conjugate()
Returns self, the complex conjugate of any int.
- bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- to_bytes(length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
- real
the real part of a complex number
- imag
the imaginary part of a complex number
- numerator
the numerator of a rational number in lowest terms
- denominator
the denominator of a rational number in lowest terms
- enum pyg90alarm.local.host_info.G90HostInfoWifiStatus(value)
Bases:
IntEnumDefines possible values of Wifi module status.
- Member Type:
Valid values are as follows:
- POWERED_OFF = <G90HostInfoWifiStatus.POWERED_OFF: 0>
- NOT_CONNECTED = <G90HostInfoWifiStatus.NOT_CONNECTED: 1>
- SERVER_NOT_CONNECTED = <G90HostInfoWifiStatus.SERVER_NOT_CONNECTED: 2>
- OPERATIONAL = <G90HostInfoWifiStatus.OPERATIONAL: 3>
The
Enumand its members also have the following methods:- conjugate()
Returns self, the complex conjugate of any int.
- bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- to_bytes(length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
- real
the real part of a complex number
- imag
the imaginary part of a complex number
- numerator
the numerator of a rational number in lowest terms
- denominator
the denominator of a rational number in lowest terms
- enum pyg90alarm.local.host_info.G90HostInfoWifiSetupProgress(value)
Bases:
IntEnumDefines possible values of Wifi connection progress.
- Member Type:
Valid values are as follows:
- IDLE = <G90HostInfoWifiSetupProgress.IDLE: 0>
- CONNECTING = <G90HostInfoWifiSetupProgress.CONNECTING: 1>
- OK = <G90HostInfoWifiSetupProgress.OK: 2>
- WRONG_SSID = <G90HostInfoWifiSetupProgress.WRONG_SSID: 3>
- WRONG_PASSWORD = <G90HostInfoWifiSetupProgress.WRONG_PASSWORD: 4>
- CONNECTION_ERROR = <G90HostInfoWifiSetupProgress.CONNECTION_ERROR: 5>
- WIFI_ERROR = <G90HostInfoWifiSetupProgress.WIFI_ERROR: 6>
The
Enumand its members also have the following methods:- conjugate()
Returns self, the complex conjugate of any int.
- bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- to_bytes(length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
- real
the real part of a complex number
- imag
the imaginary part of a complex number
- numerator
the numerator of a rational number in lowest terms
- denominator
the denominator of a rational number in lowest terms
- class pyg90alarm.local.host_info.G90HostInfo(host_guid, product_name, wifi_protocol_version, cloud_protocol_version, mcu_hw_version, wifi_hw_version, gsm_status_data, wifi_status_data, gprs_3g_active_data, wifi_setup_progress_data, battery_voltage, gsm_signal_level, wifi_signal_level)
Bases:
objectInterprets data fields of GETHOSTINFO command.
- property gsm_status: G90HostInfoGsmStatus
Translates the GSM module status received from the device into corresponding enum.
- property wifi_status: G90HostInfoWifiStatus
Translates the Wifi module status received from the device into corresponding enum.
- property wifi_setup_progress: G90HostInfoWifiSetupProgress
Translates the Wifi connection progress received from the device into corresponding enum.