All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.api.model.BoosterNodeInterface Maven / Gradle / Ivy

There is a newer version: 2.0.25
Show newest version
package org.bidib.wizard.api.model;

import org.bidib.jbidibc.messages.AccessoryState;
import org.bidib.jbidibc.messages.enums.BoosterControl;
import org.bidib.wizard.api.model.listener.BoosterStatusListener;
import org.bidib.wizard.model.status.BoosterStatus;

import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Action;
import io.reactivex.rxjava3.functions.Consumer;

public interface BoosterNodeInterface {

    static final String PROPERTY_BOOSTER_CONTROL = "boosterControl";

    /**
     * Get the wrapped node.
     * 
     * @return the node
     */
    NodeInterface getNode();

    /**
     * Add the booster status listener.
     * 
     * @param l
     *            the listener
     */
    void addBoosterStatusListener(BoosterStatusListener l);

    /**
     * Remove the booster status listener.
     * 
     * @param l
     *            the listener
     */
    void removeBoosterStatusListener(BoosterStatusListener l);

    /**
     * @param current
     *            the booster current value
     */
    void setBoosterCurrent(Integer current, long timestamp);

    /**
     * @return the booster current
     */
    Integer getBoosterCurrent();

    /**
     * @param boosterMaxCurrent
     *            the maximum booster current
     */
    void setBoosterMaximumCurrent(Integer boosterMaxCurrent);

    /**
     * @return the maximum booster current
     */
    Integer getBoosterMaximumCurrent();

    /**
     * Update the max booster current value from the features.
     */
    void fetchMaxBoosterCurrent();

    /**
     * @return the lastCurrentUpdate
     */
    Long getLastCurrentUpdate();

    /**
     * @param status
     *            the booster status
     */
    void setBoosterStatus(BoosterStatus status);

    /**
     * @return the booster status
     */
    BoosterStatus getBoosterStatus();

    /**
     * @param temperature
     *            the booster temperature
     */
    void setBoosterTemperature(Integer temperature);

    /**
     * @return the booster temperature
     */
    Integer getBoosterTemperature();

    /**
     * @param voltage
     *            the booster voltage
     */
    void setBoosterVoltage(Integer voltage);

    /**
     * @return the booster voltage
     */
    Integer getBoosterVoltage();

    /**
     * @param boosterControl
     *            the boosterControl to set
     */
    void setBoosterControl(BoosterControl boosterControl);

    /**
     * @return the boosterControl
     */
    BoosterControl getBoosterControl();

    /**
     * Update the booster control with the accessory state.
     * 
     * @param accessoryState
     *            the accessory state
     */
    void updateBoosterControl(final AccessoryState accessoryState);

    /**
     * Subscribe to changes of booster state.
     * 
     * @param onNext
     *            the data consumer
     * @param onError
     *            the error consumer
     * @return the disposable
     */
    Disposable subscribeSubjectBoosterState(
        Consumer onNext, Consumer onError, Action onComplete);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy