Closed Exelord closed 5 years ago
To define a new sensor use following template and create it in sensors folder:
sensors
import Sensor from './sensor'; export default class extends Sensor { constructor() { super(...arguments); this.sensorOptionName = 'yourSensorConfigOptionName'; } activate() { // activate the sensor } deactivate() { // deactivate the sensor } }
Next go to dark-mode/lib/dark-mode.js and add a new sensor to the sensor const.
dark-mode/lib/dark-mode.js
sensor
import MySuperSensor from './sensors/my-super-sensor.js' const sensors = [ AmbientLightSensor, MySuperSensor ]
The last thing is to add a config option in `lib/config.js
mySuperSensor: { order: 6, description: 'Determine if themes should be automatically changed by my super sensor', type: 'boolean', default: true, },
@kleineroscar @dapetcu21 This PR may help you with further development :)
To define a new sensor use following template and create it in
sensors
folder:Next go to
dark-mode/lib/dark-mode.js
and add a new sensor to thesensor
const.The last thing is to add a config option in `lib/config.js
6 #7
@kleineroscar @dapetcu21 This PR may help you with further development :)