![]() |
|
Hide seconds when using datatype 3.byte time/day - Printable Version +- LogicMachine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: OLD visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9) +--- Thread: Hide seconds when using datatype 3.byte time/day (/showthread.php?tid=3945) |
Hide seconds when using datatype 3.byte time/day - stigen - 22.03.2022 Hi! When using datatype 3.byte time/day in visualization. I want to set a time when pressing the time in visualization, but there u can also set day and seconds. Is it possible to hide seconds and day options? So its only hour and minutes you can set? Or if there is a better way to do it? -s- RE: Hide seconds when using datatype 3.byte time/day - Dré - 22.03.2022 Maybe this will help you? Resident script, run every 60 seconds Code: ---------------------- sent to virtual object for visualisation-------------------------------------------
addresstimewithoutseconds = '32/1/0' --'Time, and day [Wiser] Visualisation'
now = os.date('*t')
-- system week day starts from sunday, convert it to knx format
wday = now.wday == 1 and 7 or now.wday - 1
-- time table
time = {
day = wday,
hour = now.hour,
minute = now.min,
second = now.sec,
}
-- date table
date = {
day = now.day,
month = now.month,
year = now.year,
}
onlyhourandseconds = string.format("%02d", now.hour) .. ":" .. string.format("%02d", now.min)
old_value_onlyhourandseconds = grp.getvalue(addresstimewithoutseconds)
if old_value_onlyhourandseconds ~= onlyhourandseconds then
grp.write(addresstimewithoutseconds, onlyhourandseconds)
---------------------- sent to KNX bus-------------------------------------------
-- run only on the full hour
min = os.date('*t').min
if min == 24 then -- only sent when it is 24 minutes, not every minute
-- write to bus
grp.write('15/0/2', time, dt.time) -- 'Time, and day [Wiser]'
grp.update('15/0/1', date, dt.date) -- 'Datum' Only when date changed
end
endi thought creaded by 'Erwin van der Zwart' 15/0/1 11.3 byte date 15/0/2 10.3 byte time / day 32/1/0 250 byte string RE: Hide seconds when using datatype 3.byte time/day - admin - 22.03.2022 Add this to Custom CSS: Code: .timepicker-day,
.timepicker-second {
display: none;
}
.timepicker {
margin: 10px 0;
display: flex;
justify-content: space-evenly;
}RE: Hide seconds when using datatype 3.byte time/day - cdebackere - 23.05.2022 (22.03.2022, 14:36)admin Wrote: Add this to Custom CSS: I hoped to use this 'conditionally', so only on certain timepickers with an additional class, but embedding this code in a construct like .hourMinPick {...} does not work. HOw should that be written? RE: Hide seconds when using datatype 3.byte time/day - admin - 23.05.2022 Set Additional class to hidedaysec and use this CSS: Code: .pcontrol-hidedaysec .timepicker-day,
.pcontrol-hidedaysec .timepicker-second {
display: none;
}
.pcontrol-hidedaysec .timepicker {
margin: 10px 0;
display: flex;
justify-content: space-evenly;
}RE: Hide seconds when using datatype 3.byte time/day - JRP - 15.06.2022 (23.05.2022, 07:12)admin Wrote: Set Additional class to hidedaysec and use this CSS: Hello I have tried this custom css and it has not worked for me. Neither with the additional class hidedaysec nor with the additional class pcontrol-hidedaysec. What I have observed is that the seconds have "stopped" at zero. What could be happening? Greetings RE: Hide seconds when using datatype 3.byte time/day - admin - 16.06.2022 Which firmware version do you have? RE: Hide seconds when using datatype 3.byte time/day - JRP - 16.06.2022 Hello Wiser, 2.7.0 By the way css without additional classes doesn't work for me either. What I have in an object on the display set to Display Mode as Value. Greeatings RE: Hide seconds when using datatype 3.byte time/day - admin - 16.06.2022 This CSS only hides the second input field when changing the value. The displayed value is still in H:MM:SS format. Options to hide seconds and day from both control and display will be added in the next firmware release. RE: Hide seconds when using datatype 3.byte time/day - JRP - 16.06.2022 Ok, I'll wait for the next update then. Thank you |