-
Notifications
You must be signed in to change notification settings - Fork 963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
De-duplicate Ambient LED management code #5156
De-duplicate Ambient LED management code #5156
Conversation
d015074
to
64ab6be
Compare
Where I think this could go next -- make AmbientLighting responsible for LED stuff and call it from ExternalNotification. |
174570f
to
e38e5d0
Compare
We are trying to resolve those cross-depencencies of the modules. In principal it is good but can we use the notification system we have in the firmware for IPC. E.G. Ambient lighting offering a subscription service for LED changes and the External Notifications just using it (if available) You can look at how it's done for notifying others about GPS position changes :-) |
We currently have 4 different places where we have the logic for modifying LED state of the various types of Ambient LEDs, ExternalNotificationModule::SetExternalOff ExternalNotificationModule::SetExternalOn AmbientLightingThread::setLighting AmbientLightingThread::setLightingOff This patch de-duplicates the methods in ExternalNotification to a single method, using a boolean to toggle whether we're turning things on or off.
3825866
to
25de8e9
Compare
Thanks, I appreciate the guidance. Shall we merge this one as a start - since it'll be a while before I can get to the next steps? |
We currently have 4 different places where we have the logic for modifying LED state of the various types of Ambient LEDs, ExternalNotificationModule::SetExternalOff ExternalNotificationModule::SetExternalOn AmbientLightingThread::setLighting AmbientLightingThread::setLightingOff This patch de-duplicates the methods in ExternalNotification to a single method, using a boolean to toggle whether we're turning things on or off.
We currently have 4 different places where we have the logic for modifying LED state of the various types of Ambient LEDs, ExternalNotificationModule::SetExternalOff
ExternalNotificationModule::SetExternalOn
AmbientLightingThread::setLighting
AmbientLightingThread::setLightingOff
This patch de-duplicates the methods in ExternalNotification to a single method, using a boolean to toggle whether we're turning things on or off.