Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3e2e092
added a total of 6 methods for controlling LEDs, using #1 documentation
voltangle Dec 19, 2021
985d3c2
smol API update
voltangle Dec 19, 2021
877db52
Moved ChangeEffect enum under Enums directory, removed boilerplate
voltangle Dec 19, 2021
ad12571
added PowerState enum to represent power state (cap)
voltangle Dec 19, 2021
e31add6
Added TurnOnMode enum for setPower method
voltangle Dec 19, 2021
74cbf53
reorganised functions, added saveCurrentStateAsDefault, which represe…
voltangle Dec 19, 2021
b815220
removed unused parts of code
voltangle Dec 19, 2021
864e67c
added a struct(WIP) that will be used to represent color flow
voltangle Dec 19, 2021
b64d297
bumped minimum macOS version to 12
voltangle Dec 19, 2021
66b4f74
fixed availability issues for Device class
voltangle Dec 19, 2021
418ac93
removed QueryString because it was unused
voltangle Dec 19, 2021
615fca2
compacted Region enum
voltangle Dec 19, 2021
005ec6b
changed how startColorFlow works, also made it working
voltangle Dec 19, 2021
18d65ed
added Package.resolved to .gitignore
voltangle Dec 21, 2021
9e55c5a
upd readme
voltangle Dec 22, 2021
357e0a4
added an enum that represents available device properties
voltangle Dec 22, 2021
96b82e7
added get(properties:of:) and get(property:of:) functions
voltangle Dec 22, 2021
33ab33f
started implementing docs
voltangle Dec 22, 2021
c86bddc
moved enums to their respective folder
voltangle Dec 23, 2021
f930ec6
feat: full project rebranding from YeeLampa to YeelightKit
voltangle Jan 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
xcuserdata/
DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
Package.resolved
91 changes: 0 additions & 91 deletions .swiftpm/xcode/xcshareddata/xcschemes/YeeLampa.xcscheme

This file was deleted.

10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
import PackageDescription

let package = Package(
name: "YeeLampa",
name: "YeelightKit",
platforms: [
.iOS(.v13),
.macOS(.v10_15)
.macOS(.v12)
],
products: [
.library(
name: "YeeLampa",
targets: ["YeeLampa"]),
name: "YeelightKit",
targets: ["YeelightKit"]),
],
dependencies: [
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.5.0"))
],
targets: [
.target(
name: "YeeLampa",
name: "YeelightKit",
dependencies: ["Alamofire"],
resources: [
.copy("Resources/DeviceProps.plist")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# YeeLampa
# YeelightKit

A Swift package to interact with Yeelight devices.
A Swift package for type-safe interactions with Yeelight API.
8 changes: 8 additions & 0 deletions Sources/Documentation.docc/Documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ``YeelightKit``

A Swift package for type-safe interactions with Yeelight API.

## Overview

yee

20 changes: 0 additions & 20 deletions Sources/YeeLampa/ChangeEffect.swift

This file was deleted.

17 changes: 0 additions & 17 deletions Sources/YeeLampa/QueryString.swift

This file was deleted.

18 changes: 0 additions & 18 deletions Sources/YeeLampa/Region.swift

This file was deleted.

103 changes: 0 additions & 103 deletions Sources/YeeLampa/YeeLampa.swift

This file was deleted.

11 changes: 11 additions & 0 deletions Sources/YeelightKit/Enums/ChangeEffect.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// File.swift
//
//
// Created by Егор Яковенко on 18.12.2021.
//

public enum ChangeEffect: String {
case sudden
case smooth
}
12 changes: 12 additions & 0 deletions Sources/YeelightKit/Enums/ColorFlowExpression.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// ColorFlowExpression.swift
//
//
// Created by Егор Яковенко on 19.12.2021.
//

public enum ColorFlowExpression {
case color(duration: Int, value: (red: Int, green: Int, blue: Int), brightness: Int?)
case colorTemperature(duration: Int, value: (red: Int, green: Int, blue: Int), brightness: Int?)
case sleep(duration: Int, value: (red: Int, green: Int, blue: Int))
}
33 changes: 33 additions & 0 deletions Sources/YeelightKit/Enums/DeviceProperty.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// DeviceProperty.swift
//
//
// Created by Егор Яковенко on 22.12.2021.
//

/// An enum for representing device properties. Used in ``YeelightKit/YeelightKit/get(properties:of:)`` function, to get individual properties of a device.
public enum DeviceProperty: String {
case isOn = "power"
case brightness = "bright"
case colorTemperature = "ct"
case rgbColor = "rgb"
case hue
case saturation = "sat"
case colorMode = "color_mode"
/// Is the flow mode running.
case isFlowing = "flowing"
case isMusicModeOn = "music_on"
case name
case isBackgroundOn = "bg_power"
/// Is the flow mode running on background light.
case isBackgroundFlowing = "bg_flowing"
case backgroundColorTemperature = "bg_ct"
case backgroundColorMode = "bg_lmode"
case backgroundBrightness = "bg_bright"
case backgroundRgbColor = "bg_rgb"
case backgroundHue = "bg_hue"
case backgroundSaturation = "bg_sat"
case nightLightBrightness = "nl_br"
/// Only applicable for the ceiling light.
case activeMode = "active_mode"
}
11 changes: 11 additions & 0 deletions Sources/YeelightKit/Enums/PowerState.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// PowerState.swift
//
//
// Created by Егор Яковенко on 19.12.2021.
//

public enum PowerState: String {
case on
case off
}
11 changes: 11 additions & 0 deletions Sources/YeelightKit/Enums/Region.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Region.swift
//
//
// Created by Егор Яковенко on 28.11.2021.
//

public enum Region: String {
case Germany = "de"
case Russia = "ru"
}
Loading