'Get the latest data from the remote SNMP capable host.'

def update(self):

    from pysnmp.hlapi import getCmd, CommunityData, SnmpEngine, UdpTransportTarget, ContextData, ObjectType, ObjectIdentity
    (errindication, errstatus, errindex, restable) = next(getCmd(SnmpEngine(), CommunityData(self._community, mpModel=self._version), UdpTransportTarget((self._host, self._port)), ContextData(), ObjectType(ObjectIdentity(self._baseoid))))
    if errindication:
        _LOGGER.error('SNMP    error:    %s', errindication)
    elif errstatus:
        _LOGGER.error('SNMP    error:    %s    at    %s', errstatus.prettyPrint(), ((errindex and restable[(-1)][(int(errindex) - 1)]) or '?'))
    else:
        for resrow in restable:
            self.value = resrow[(-1)]
