def update(self):
     """Get the latest state of the sensor."""
     from pyetherscan import get_balance
     if self._token_address:
         self._state = get_balance(self._address, self._token_address)
     elif self._token:
         self._state = get_balance(self._address, self._token)
     else:
         self._state = get_balance(self._address)
Example #2
0
    def update(self):
        """Get the latest state of the sensor."""

        if self._token_address:
            self._state = get_balance(self._address, self._token_address)
        elif self._token:
            self._state = get_balance(self._address, self._token)
        else:
            self._state = get_balance(self._address)
Example #3
0
 def update(self):
     """Get the latest state of the sensor."""
     from pyetherscan import get_balance
     if self._token_address:
         self._state = get_balance(self._address, self._token_address)
     elif self._token:
         self._state = get_balance(self._address, self._token)
     else:
         self._state = get_balance(self._address)
Example #4
0
 def update(self):
     """Get the latest state of the sensor."""
     from pyetherscan import get_balance
     self._state = get_balance(self.address)