[freeboxos] Avoid a call to the lcd API when no required (#17254)

Fix #17253

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2024-08-14 13:58:45 +02:00 committed by GitHub
parent 034c03f9aa
commit d332dd41f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,18 +47,17 @@ public class RevolutionHandler extends ServerHandler {
@Override @Override
protected boolean internalHandleCommand(String channelId, Command command) throws FreeboxException { protected boolean internalHandleCommand(String channelId, Command command) throws FreeboxException {
LcdManager manager = getManager(LcdManager.class); LcdManager manager = getManager(LcdManager.class);
Config config = manager.getConfig();
switch (channelId) { switch (channelId) {
case LCD_BRIGHTNESS: case LCD_BRIGHTNESS:
setBrightness(manager, config, command); setBrightness(manager, manager.getConfig(), command);
internalPoll(); internalPoll();
return true; return true;
case LCD_ORIENTATION: case LCD_ORIENTATION:
setOrientation(manager, config, command); setOrientation(manager, manager.getConfig(), command);
internalPoll(); internalPoll();
return true; return true;
case LCD_FORCED: case LCD_FORCED:
setForced(manager, config, command); setForced(manager, manager.getConfig(), command);
internalPoll(); internalPoll();
return true; return true;
} }