govee_api/lib.rs
1pub mod api;
2pub mod structs;
3pub mod tests;
4pub mod utils;
5
6pub const GOVEE_ROOT_URL: &str = "https://developer-api.govee.com";
7
8/// A client for interacting with Govee devices through their API.
9///
10/// This struct provides methods to control Govee devices using the Govee API.
11/// It requires a valid Govee API key and root URL to initialize.
12pub struct GoveeClient {
13 govee_api_key: String, // The API key for authenticating requests.
14 govee_root_url: String, // The root URL of the Govee API.
15}
16
17impl GoveeClient {
18 /// Creates a new instance of the GoveeClient with the specified API key and root URL.
19 ///
20 /// # Arguments
21 ///
22 /// * `govee_api_key` - A valid Govee API key for authentication.
23 /// * `govee_root_url` - The root URL of the Govee API.
24 ///
25 /// # Returns
26 ///
27 /// A new GoveeClient instance.
28 pub fn new(api_key: &str) -> GoveeClient {
29 GoveeClient {
30 govee_api_key: api_key.to_string(),
31 govee_root_url: GOVEE_ROOT_URL.to_string(),
32 }
33 }
34}