<?php

namespace shelly;
require_once WD . '/modules/shelly/config/shelly_enabled_c.php';
require_once WD . '/modules/shelly/config/shelly_secret_key_c.php';
require_once WD . '/modules/shelly/config/shelly_server_url_c.php';
// Require helpers
require_once WD . '/modules/shelly/helpers/shelly_device_state.php';
require_once WD . '/modules/shelly/helpers/shelly_device_switch.php';

require_once WD . '/modules/shelly/helpers/shelly_request_body_get_states.php';
require_once WD . '/modules/shelly/helpers/shelly_response_body_get_states.php';

use shelly\config\shelly_server_url_c;
use shelly\config\shelly_enabled_c;
use shelly\config\shelly_secret_key_c;
use traits\module_config_t;

class shelly_c
{
    use module_config_t;

    /**
     * The status of the shelly module
     * @var shelly_enabled_c
     */
    public shelly_enabled_c $enabled;
    /**
     * The secret key for the shelly module (API token)
     * @var shelly_secret_key_c
     */
    public shelly_secret_key_c $secret_key;
    /**
     * The server url for the shelly module
     * @var shelly_server_url_c
    */
    public shelly_server_url_c $server_url;

    public function __construct()
    {
        $this->setupConfig('shelly');
        $this->allowUpdate([
            shelly_enabled_c::class,
            shelly_secret_key_c::class,
            shelly_server_url_c::class
        ]);
        $this->enabled = new shelly_enabled_c();
        $this->secret_key = new shelly_secret_key_c();
        $this->server_url = new shelly_server_url_c();
    }
}