fixing key error when calling AnalogEntity().unit