added local time characteristic #4
@ -720,11 +720,11 @@ func (i *Device) SetTime(t time.Time) error {
|
||||
}
|
||||
|
||||
if err := i.checkStatus(i.localTimeChar, LocalTimeChar); err != nil {
|
||||
// this characteristic might not be there in older versions of infinitime
|
||||
// so we fail silently in this case.
|
||||
_, notAvailable := err.(ErrCharNotAvail)
|
||||
if notAvailable {
|
||||
log.Warn().Msg("No Local Time Characteristic detected. Old Version of Infinitime (pre 1.10.0)?")
|
||||
// If the characteristic is unavailable,
|
||||
// fail silently, as many people may be on
|
||||
// older InfiniTime versions. A warning
|
||||
// may be added later.
|
||||
if _, ok := err.(ErrCharNotAvail); ok {
|
||||
return nil
|
||||
} else {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user