@property
def state(self) -> (str | None):
    'Return the state of the sensor.'
    if (self.dev.state == ''):
        return None
    try:
        state = int(self.dev.state)
    except ValueError:
        state = float(self.dev.state)
    return state
Return the state of the sensor.
@property
def state(self) -> (str | None):
    
    if (self.dev.state == ):
        return None
    try:
        state = int(self.dev.state)
    except ValueError:
        state = float(self.dev.state)
    return state