Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libreria Message Lighting - detectDeviceType() #23

Open
Gozilla01 opened this issue Jul 30, 2019 · 0 comments
Open

Libreria Message Lighting - detectDeviceType() #23

Gozilla01 opened this issue Jul 30, 2019 · 0 comments
Labels
Implementazione Implementazione

Comments

@Gozilla01
Copy link
Owner

Gozilla01 commented Jul 30, 2019

Modificare detectDeviceType()
Modificare if per:

  • Includere i nuovi WHAT temporizzati come SCS_ON_OFF_SWITCH.
    Attualmente se si riceve *1*17*23##, il discovery lo riconosce come SCS_DIMMER_SWITCH.
@Override
    public OpenDeviceType detectDeviceType() {
        if (this.isCommand()) {
            final What what;
            OpenDeviceType openDeviceType;
            if ((what = this.getWhat()) == WHAT.OFF || what == WHAT.ON || what == WHAT.MOVEMENT_DETECTED
                    || what == WHAT.END_MOVEMENT_DETECTED) {
                openDeviceType = OpenDeviceType.SCS_ON_OFF_SWITCH;
            } else {
                openDeviceType = OpenDeviceType.SCS_DIMMER_SWITCH;
            }
            return openDeviceType;
        }
        return null;
    }
  • Visto la nuova implementazione per bus_motion_detector è opportuno aggiungere e gestire un nuovo OpenDeviceType con WHAT.MOVEMENT_DETECTED e WHAT.END_MOVEMENT_DETECTED ?
    es. OpenDeviceType.SCS_MOTION_DETECTOR_SWITCH

Questo estratto da OpenWebNetDeviceDiscoveryService

case SCS_ON_OFF_SWITCH: {
                    if (baseMsg.getWhat().equals(WHAT.MOVEMENT_DETECTED)
                            || baseMsg.getWhat().equals(WHAT.END_MOVEMENT_DETECTED)) {
                        thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_MOTION_DETECTOR;
                        thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_DETECTOR;
                        deviceWho = Who.LIGHTING;
                        break;
                    } else {
                        thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_ON_OFF_SWITCH;
                        thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_ON_OFF_SWITCH;
                        deviceWho = Who.LIGHTING;
                        break;
                    }
                }
case SCS_DIMMER_SWITCH: {

Se si, eliminare la gestione WHAT.MOVEMENT_DETECTED e WHAT.END_MOVEMENT_DETECTED all'interno del OpenWebNetLightingHandler.

@Gozilla01 Gozilla01 added the Implementazione Implementazione label Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementazione Implementazione
Projects
None yet
Development

No branches or pull requests

1 participant