Endpoint.py 681 Bytes
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun  9 11:15:10 2021

@author: Georges de Massol
"""
import base64
#import binascii

class Endpoint:
    def __init__(self, EUI = None):
        """

        Parameters
        ----------
        EUI : bytes
            ex : bytes([0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01])

        Returns
        -------
        None.

        """
        # This must point to the API interface.
        self.EUI = EUI
        
        #EUI = bytes([0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01])
    def EUIfromjson(self, json):
        self.EUI = base64.b64decode(json["devEUI"]).hex()
        return self.EUI