refactor domotic class