Code Monkey home page Code Monkey logo

smartthings-core-sdk's People

Contributors

bflorian avatar dependabot[bot] avatar github-actions[bot] avatar jodyalbritton avatar john-u avatar keithmkolmos avatar kidongcho avatar rossiam avatar saulfloresbluetrail avatar semantic-release-bot avatar sitlintac avatar smartthingspi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smartthings-core-sdk's Issues

no health event is coming

called subscribeToDeviceHealth() function.
when device goes to offline or online, DEVICE_HEALTH_EVENT is supposed to be come.
but it is not.

scope":["r:locations:","x:devices:","r:devices:*"] are used.

but subscribeToDeviceLifecycle() is well working, when device is registered and unregistered with DEVICE_LIFECYCLE_EVENT.

question:

What is your question? Please describe.
A clear and concise question.

Additional context
Add any other context or screenshots about the question here.

Reporting a vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

Git clone fails on Windows10

error: invalid path 'test/unit/data/history/get?after=1596813799499&afterHash=1424849460&limit=20&oldestFirst=false&offset=0&locationId=3749dfe2&deviceId=c8fc80fc.ts'
fatal: unable to checkout working tree

Commit dd95c5b

Rules api missing "changes" operation

Describe the bug
The documentation mentions a changes operation that is not present in the sdk.

To Reproduce
Try to create a rule with the changes operation.

Expected behavior
Expect the SDK to implement the documented operations

Actual behavior
Missing changes operation

create subscription api should be use POST method?!

create subscription API method doesn't match. I think It should be POST, but PUT.

API description : https://librarian-regionals.smartthingsgdev.com/api/api.smartthings.com.v1#operation/saveSubscription
core-sdk :

return this.client.put<Subscription>(`${this.installedAppId(installedAppId)}/subscriptions/`, data)

error console :
Error: Request failed with status code 405: {"requestId":"D70F1365-36AE-4990-9BAE-5D3EDCF8E5E7","error":{"code":"MethodNotAllowedError","message":"PUT is not an allowed HTTP method for the requested resource.","details":[]}}

Subscription examples

Hi,

Everythings seems to work very fine, but Subscriptions documentation is quite messy. I cannot figure out how to subscribe my device events.

Typescript Function parameters

Could you write these input parameters as object as well
image
In this way
image
I think using objects as input params makes it way more errorless and easier to extend input parameters

Getting 401 Authorization Required error for BearerTokenAuthenticator

const authenticator = new BearerTokenAuthenticator({
token: 'xxxxxxx',
});

const client = new SmartThingsClient(authenticator);
client.locations.list().then(locations => {
console.log(FoundFoundFound ${locations.length} locations)
}) .catch(err => { console.log('errerrerr',err);

});

I am getting 401 Authorization Required for a proper PAT

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

question: device serial number

What is your question? Please describe.
Is there a call to get the serial number of a device?

Additional context
I want to get the serial number of my TV using the SmartThings API. I could not find it using one of the API calls. Is there one that I might have missed or is getting the serial number not supported?

Rules API RuleRequest typing is wrong

I used this project with Typescript to create a new rule and typing is misleading us on the data structure.

For example: greaterThan should be greater_than and _else should be else

When I follow the typing I receive this from the server:

{"code":"BodyMalformedError","target":"greaterThan","message":"Unknown field on line 1","details":[]}]}

If you don't want to use the same name convention on JS side, you should at least process the data to remap them.

2 Questions using smartthings-core-sdk/src/endpoint/devices apis

Is there a way to delete devices within installedAppId?
(delete the devices installed by specific Installedapp)

public delete(id: string): Promise<Device> {

Is there a way to create devices with not only locationId but also the roomId?
(If I use the create api, it only generates the device at the location with no room specified)

public create(definition: DeviceCreate | AlternateDeviceCreate): Promise<Device> {

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch master on the remote Git repository with URL https://github.com/SmartThingsCommunity/smartthings-core-sdk.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Add "ordered" Parameter to Devices executeCommand()

Is your feature request related to a problem? Please describe.
While writing a custom script to trigger functionality in my Samsung Fridge, I noticed that this SDK did not support the REST API's ordered parameter in the SDK

Describe the solution you'd like
Add an optional ordered parameter that adds an ordered parameter to the executeCommands payload when ordered === true

Describe alternatives you've considered
None at this time - you could technically add another method to the SDK, but the suggested implementation is simpler and wouldn't break the existing API

Additional context
image

Errors returned from the API are not returned by the SDK.

As an example, let's call the executeCommand call in the devices API:

client.devices.executeCommand(id, command).then(result => {
	this.log(`success: ${result}`)
}).catch(error => {
	this.log(`error = ${error}`)
})

This method always returns successfully even when the API returns an error. Simply adding an await to the executeCommand fixes the issue:

public async executeCommands(id: string, commands: Command[]): Promise<Status> {
	// TODO: add this await here
	await this.client.post(`${id}/commands`, { commands })
	return SuccessStatusValue
}

NOTE: This will need to be added consistently throughout the SDK.

[Washer] Help needed for setWasherCycle

Hello,
I own a samsung connected washer.
I can't change the cycle.

client.devices.executeCommand(WASHER_ID, { "component": "main", "capability": "samsungce.washerCycle", "command": "setWasherCycle", "arguments": ["Table_02_Course_25"] } ).then((response) => { console.log(response); });

The response of the webservice is fine:
{ status: 'success' }

But the cycle of my washer remains untouched with this command.

Can you help me?

Thank you

TS definition `_else` for `IfAction` is incorrect, should be `else`

This still appears wrong to me

'_else'?: Action[]

and I'm getting

[{\"code\":\"BodyMalformedError\",\"target\":\"_else\",\"message\":\"Unknown field on line 1\",\"details\":[]}]}}'

back from the API.

This issue was somewhat referenced in #56 with a claim it should now sync up but it seems to still be outstanding.

From what I see, the _else? property should be else?, as the code at the bottom of the same file i referenced just puts that exact JSON object into the api body payload, and according to the api docs and all JSON payload examples I see it is incorrect?

Schlage Connect Zigbee Lock (BE468 ) Event Data Empty

Describe the bug
Event Data is empty

To Reproduce
Subscribe to events form the schalge device and the data object in the event will always be empty despite the CLI's edge:drivers:logcat command showing the data object for the event from the driver has a value:
(Home Schlage Door Lock)> emitting event: {"component_id":"main","capability_id":"lock","attribute_id":"lock","state":{"value":"locked","data":{"method":"command"}}}
and here's the event from the SDK:
{"eventTime":"2023-09-14T11:17:51Z","eventType":"DEVICE_EVENT","deviceEvent":{"eventId":"","locationId":"","ownerId":"","ownerType":"LOCATION","deviceId":"","componentId":"main","capability":"lock","attribute":"lock","value":"unlocked","valueType":"string","stateChange":true,"data":{},"subscriptionName":"*"}}

Expected behavior
the data object should be populated as captured by the edge driver

Actual behavior
the data object is empty

switch from `interface` preference to `type` preference

In the CLI, we have already converted code to prefer type over interface. Let's do the same in this project.

In the end we want this in our eslint.js file:

'@typescript-eslint/consistent-type-definitions': ['error', 'type'],

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.