marginal updates

fixing empty list at get_appliance_state_by_edge_detection

simplifying median filter