Skip to content

Feature Request: Have get_local_time() Do Something With UTC Offset #16

Closed
@PaintYourDragon

Description

@PaintYourDragon

The data’s there in the Adafruit IO time response but is currently discarded. This could either be returned by the function (in which case, programs that don’t need it can just ignore) or stored in the class somewhere (requiring a name or getter function and a few bytes of RAM).

This is rare, but some things do want a valid UTC offset…anything using the MET Norway sun/moon API for example (Moon phase clock, LED shadow box), maybe others. The current workaround is to follow a call to get_local_time() with a second “manual” query from Adafruit IO that requests just the UTC string. Doing this once on startup won’t suffice, since it changes twice a year. During the periodic time syncs that a lot of projects do anyway seems preferable.

I’m not too concerned with the representation. Adafruit IO response is a string 'sHHMM' (sign, hours, minutes), MET Norway wants 'sHH:MM', but it’s a trivial conversion, so I’d maybe just keep the original response string (e.g. don’t separate into integer tuple, because reasons).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions