Skip to content

Commit a7b05b8

Browse files
brentrubrentru
brentru
authored and
brentru
committed
add getter/setter for device_id property
1 parent 2b01b1e commit a7b05b8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

adafruit_azureiot.py

+12
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ def __init__(self, wifi_manager, iot_hub_name, sas_token, device_id):
6767
self._device_id = device_id
6868
self._azure_header = {"Authorization":self._sas_token}
6969

70+
@property
71+
def device_id(self):
72+
"""Returns the current device identifier"""
73+
return self._device_id
74+
75+
@device_id.setter
76+
def device_id(self, device_identifier):
77+
"""Sets the current device identifier
78+
:param str device_identifier: Unique device identifier.
79+
"""
80+
self._device_id = device_identifier
81+
7082
@staticmethod
7183
def _parse_http_status(status_code, status_reason):
7284
"""Parses status code, throws error based on Azure IoT Common Error Codes.

0 commit comments

Comments
 (0)