| 46 | MODULE_WITH_PAUSE("GAMMA"); |
| 47 | |
| 48 | static void init(void) { |
| 49 | m_ref("DAYTIME", &daytime_ref); |
| 50 | M_SUB(BL_UPD); |
| 51 | M_SUB(TEMP_REQ); |
| 52 | M_SUB(AMB_GAMMA_REQ); |
| 53 | M_SUB(DAYTIME_UPD); |
| 54 | M_SUB(NEXT_DAYEVT_UPD); |
| 55 | M_SUB(SUSPEND_UPD); |
| 56 | |
| 57 | // Store current temperature to later restore it if requested |
| 58 | SYSBUS_ARG_REPLY(args, parse_bus_reply, &initial_temp, CLIGHTD_SERVICE, "/org/clightd/clightd/Gamma", "org.clightd.clightd.Gamma", "Get"); |
| 59 | if (call(&args, "ss", fetch_display(), fetch_env()) < 0) { |
| 60 | // We are on an unsupported wayland compositor; kill ourself immediately without further message processing |
| 61 | WARN("Failed to init. Killing module.\n"); |
| 62 | module_deregister((self_t **)&self()); |
| 63 | } else { |
| 64 | m_become(waiting_daytime); |
| 65 | init_Gamma_api(); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | static bool check(void) { |
| 70 | return true; |
nothing calls this directly
no test coverage detected