-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Background This PR introduces better UI generator with new button types and icons This PR also introduces new route `/infrareds?brand_id=0` to see brand's infrared files
- Loading branch information
1 parent
c789c5e
commit 370dd43
Showing
55 changed files
with
1,959 additions
and
495 deletions.
There are no files selected for viewing
Submodule IRDB
updated
5134 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ org.gradle.parallel=true | |
makeevrserg.project.name=IfrBackend | ||
makeevrserg.project.url=https://github.com/makeevrserg/IfrSample | ||
makeevrserg.project.group=com.flipperdevices.ifrmvp.backend | ||
makeevrserg.project.version.string=0.2.1 | ||
makeevrserg.project.version.string=0.3.0 | ||
makeevrserg.project.description=Api for IfrSample | ||
makeevrserg.project.developers=makeevrserg|Makeev Roman|[email protected] | ||
# Java | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...flipperdevices/ifrmvp/generator/config/category/api/AirPurifierCategoryConfigGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.flipperdevices.ifrmvp.generator.config.category.api | ||
|
||
import com.flipperdevices.ifrmvp.backend.model.CategoryConfiguration | ||
import com.flipperdevices.ifrmvp.backend.model.CategoryType | ||
import com.flipperdevices.ifrmvp.backend.model.DeviceKey | ||
import com.flipperdevices.ifrmvp.generator.config.category.api.DeviceKeyExt.getAllowedCategories | ||
import com.flipperdevices.ifrmvp.model.buttondata.IconButtonData | ||
import com.flipperdevices.ifrmvp.model.buttondata.PowerButtonData | ||
import com.flipperdevices.ifrmvp.model.buttondata.ShutterButtonData | ||
import com.flipperdevices.ifrmvp.model.buttondata.TextButtonData | ||
|
||
object AirPurifierCategoryConfigGenerator { | ||
@Suppress("LongMethod") | ||
fun generate(): CategoryConfiguration { | ||
var i =0 | ||
return CategoryConfiguration( | ||
orders = listOf( | ||
CategoryConfiguration.OrderModel( | ||
data = PowerButtonData(), | ||
message = "Does %s turns on?", | ||
key = DeviceKey.PWR, | ||
index = ++i, | ||
), | ||
CategoryConfiguration.OrderModel( | ||
message = "Is it oscillated?", | ||
data = TextButtonData(text = "OSC"), | ||
key = DeviceKey.OSCILLATE, | ||
index = ++i, | ||
), | ||
CategoryConfiguration.OrderModel( | ||
message = "Is Fan speed increased??", | ||
data = TextButtonData(text = "FS+"), | ||
key = DeviceKey.FAN_SPEED_UP, | ||
index = ++i, | ||
), | ||
CategoryConfiguration.OrderModel( | ||
message = "Is Fan speed decreased?", | ||
data = TextButtonData(text = "FS-"), | ||
key = DeviceKey.FAN_SPEED_DOWN, | ||
index = ++i, | ||
), | ||
CategoryConfiguration.OrderModel( | ||
message = "Does it swing?", | ||
data = TextButtonData(text = "SW"), | ||
key = DeviceKey.SWING, | ||
index = ++i, | ||
), | ||
) | ||
) | ||
} | ||
|
||
fun generate(categoryType: CategoryType): CategoryConfiguration { | ||
val configuration = generate() | ||
return CategoryConfiguration( | ||
orders = configuration.orders.filter { | ||
it.key.getAllowedCategories().contains(categoryType) | ||
} | ||
) | ||
} | ||
} |
104 changes: 0 additions & 104 deletions
104
...lin/com/flipperdevices/ifrmvp/generator/config/category/api/AllCategoryConfigGenerator.kt
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
.../flipperdevices/ifrmvp/generator/config/category/api/AvReceiverCategoryConfigGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.flipperdevices.ifrmvp.generator.config.category.api | ||
|
||
import com.flipperdevices.ifrmvp.backend.model.CategoryConfiguration | ||
import com.flipperdevices.ifrmvp.backend.model.CategoryType | ||
import com.flipperdevices.ifrmvp.backend.model.DeviceKey | ||
import com.flipperdevices.ifrmvp.generator.config.category.api.DeviceKeyExt.getAllowedCategories | ||
import com.flipperdevices.ifrmvp.model.buttondata.IconButtonData | ||
import com.flipperdevices.ifrmvp.model.buttondata.PowerButtonData | ||
import com.flipperdevices.ifrmvp.model.buttondata.ShutterButtonData | ||
import com.flipperdevices.ifrmvp.model.buttondata.TextButtonData | ||
|
||
object AvReceiverCategoryConfigGenerator { | ||
@Suppress("LongMethod") | ||
fun generate(): CategoryConfiguration { | ||
var i = 0 | ||
return CategoryConfiguration( | ||
orders = listOf( | ||
CategoryConfiguration.OrderModel( | ||
data = PowerButtonData(), | ||
message = "Does %s turns on?", | ||
key = DeviceKey.PWR, | ||
index = ++i, | ||
), | ||
CategoryConfiguration.OrderModel( | ||
message = "Does volume go up?", | ||
data = IconButtonData(iconId = IconButtonData.IconType.VOL_UP), | ||
key = DeviceKey.VOL_UP, | ||
index = ++i, | ||
), | ||
CategoryConfiguration.OrderModel( | ||
message = "Does volume go down?", | ||
data = IconButtonData(iconId = IconButtonData.IconType.VOL_DOWN), | ||
key = DeviceKey.VOL_DOWN, | ||
index = ++i, | ||
), | ||
CategoryConfiguration.OrderModel( | ||
message = "Is volume muted?", | ||
data = IconButtonData(iconId = IconButtonData.IconType.MUTE), | ||
key = DeviceKey.MUTE, | ||
index = ++i, | ||
), | ||
CategoryConfiguration.OrderModel( | ||
message = "Is menu opened?", | ||
data = IconButtonData(iconId = IconButtonData.IconType.MENU), | ||
key = DeviceKey.MENU, | ||
index = ++i, | ||
) | ||
) | ||
) | ||
} | ||
|
||
fun generate(categoryType: CategoryType): CategoryConfiguration { | ||
val configuration = generate() | ||
return CategoryConfiguration( | ||
orders = configuration.orders.filter { | ||
it.key.getAllowedCategories().contains(categoryType) | ||
} | ||
) | ||
} | ||
} |
Oops, something went wrong.