This file contains hidden or 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
| blueprint: | |
| name: "Dynamic Light Brightness (Lux Based)" | |
| description: > | |
| This blueprint dynamically adjusts a light's brightness to complement the ambient light levels detected by an illuminance (lux) sensor. | |
| It maps a defined range of lux values (from a minimum to a maximum) to a corresponding brightness range (e.g., 10 lux → 10% brightness, 500 lux → 100% brightness). The brightness is calculated using linear interpolation, ensuring smooth transitions as the ambient light changes. | |
| The automation is only active when the target light is already turned on. | |
| **Key Features:** |
This file contains hidden or 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
| package com.example | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.ui.platform.LocalInspectionMode | |
| import com.google.accompanist.permissions.ExperimentalPermissionsApi | |
| import com.google.accompanist.permissions.PermissionState | |
| import com.google.accompanist.permissions.PermissionStatus | |
| /** | |
| * Wrapper for [com.google.accompanist.permissions.rememberPermissionState] to grant permissions when in Inspection mode |
This file contains hidden or 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
| @Composable | |
| fun CameraPreview( | |
| modifier: Modifier = Modifier, | |
| scaleType: PreviewView.ScaleType = PreviewView.ScaleType.FILL_CENTER, | |
| cameraSelector: CameraSelector = CameraSelector.DEFAULT_FRONT_CAMERA | |
| ) { | |
| val lifecycleOwner = LocalLifecycleOwner.current | |
| AndroidView( | |
| modifier = modifier, | |
| factory = { context -> |
This file contains hidden or 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
| #!/usr/bin/python | |
| import http.client | |
| import httplib2 | |
| import os | |
| import random | |
| import sys | |
| import time | |
| from apiclient.discovery import build |
This file contains hidden or 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
| package com.example | |
| import android.content.Context | |
| import android.nfc.tech.MifareClassic | |
| object NfcUtils { | |
| fun Context.isMifareClassicCompatible(): Boolean = | |
| packageManager.systemAvailableFeatures.any { it.name == "com.nxp.mifare" } |
This file contains hidden or 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
| package com.example | |
| import android.app.Activity | |
| import android.nfc.NfcAdapter | |
| import android.nfc.Tag | |
| import androidx.lifecycle.DefaultLifecycleObserver | |
| import androidx.lifecycle.LifecycleOwner | |
| class NfcTagLifecycleObserver( | |
| private val activity: Activity, |
This file contains hidden or 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
| package com.example | |
| import io.reactivex.rxjava3.disposables.Disposable | |
| import io.reactivex.rxjava3.exceptions.CompositeException | |
| import io.reactivex.rxjava3.exceptions.Exceptions | |
| import io.reactivex.rxjava3.internal.util.ExceptionHelper | |
| /** | |
| * A disposable that can hold onto multiple other Disposables | |
| * and only keeps the last Disposable added with the same key. |
This file contains hidden or 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
| package com.example | |
| import android.content.Context | |
| import android.graphics.Canvas | |
| import android.graphics.Paint | |
| import android.graphics.Rect | |
| import android.graphics.Typeface | |
| import android.text.TextPaint | |
| import android.util.AttributeSet | |
| import com.google.android.material.textfield.TextInputEditText |
This file contains hidden or 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
| import android.graphics.ImageFormat | |
| import android.graphics.Rect | |
| import android.graphics.YuvImage | |
| import android.media.Image | |
| import com.bumptech.glide.Priority | |
| import com.bumptech.glide.load.DataSource | |
| import com.bumptech.glide.load.data.DataFetcher | |
| import java.io.ByteArrayOutputStream | |
| import java.nio.ByteBuffer |
This file contains hidden or 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
| package com.example | |
| import android.view.View | |
| import android.view.ViewGroup | |
| import androidx.annotation.Px | |
| import androidx.core.view.ViewCompat | |
| import androidx.core.view.updateLayoutParams | |
| import androidx.recyclerview.widget.RecyclerView | |
| import androidx.viewpager2.widget.ViewPager2 |
NewerOlder