good smart home actions for dimmer switch - actions-on-google

I want to develop smart home actions for dimmer product,
What device traits type I need to use, I know it need
OnOff traits, but what about the power level control,
it need to set 0-100%, what trait I need to use?

For a light dimmer, in addition to the OnOff trait, it sounds like you want to implement the Brightness trait. This lets you set the power level to an integer in between 0 and 100 inclusive.

Related

Dynamic views depending on how many views are present with free form movement

I wasn't sure how to word this so bear with me :p
Here is a screenshot of an idea I want to implement but I'm not sure how best to approach it or ever describe it.
I can do it in either React Native or native iOS so ideas in either realm would be great.
The idea is when there is only one person in the room your video would be a bit bigger and as people join they would scale properly for the phone and be placed in a fun layout (doesn't have to be exactly as shown, just the idea is they scale to take up the best space possible depending on device size and how many people are in the room)
I'm thinking some sort of game engine would be useful for this but not sure. If you could throw out some search terms I could use to approach it it would be great.
I also might want them to be draggable/resizable but I can do that later but the idea is that they are more freeform movements within a certain container size.
This is basic grid functionality, you just have to create styling use cases for each sizing option, and dynamically change the classes based on the number of people in the chatroom... in a really basic form:
.6-user-layout {
height: 60px;
width: 60px;
}
.4-user-layout {...}
.2-user-layout {...}
As your basic styling ^ then simply swap your classes out dynamically:
const sizingClass = \`${userCount}-user-layout\`;
return (
<YourVideo classNames={sizingClass} />
);
Unless you are looking for some really specific methods, this is a simple way to do it with React regardless of Browser or Mobile :)
The same goes for any game engine, just define your styling requirements for each number of users or create a simple equation to figure it out, whilst tracking the active users.

How to use and create and handle Model class in IOS?

i want to increment and decrement a variable trough out the application as i am using that in many views of the application. I am working on a game for iOS. I want to store the score in a variable and when the user start playing game there are two or three points where the users can loose the score like -1 before start playing the game even. Suppose i am giving the user three options for something if he choose first then he move to the next step if he will return back and want to choose second option he will have to bear -1 from his score and again if he go for third same process will be followed.
I think you only have to make singleton class to solve this
follow the answer What should my Objective-C singleton look like? it have the idea of singleton

iphone How to make custom UISwitch with three states (options)

I want to make Switch, which have three states.Basically I need to store value 0 or 1 or 2.
By checking the state of Switch.
Please Help to make this switch.If it can be made Using IB that will be very nice because it will be easy to place in the right place.
(I have image but not able to show bec am new, dont have 10 reputation yet)
Thanks in advance for your creative thinking
You should use a UISegmentedControl for this. It's part of the standard set of controls, Apple has taken care of accessibility support, and users will know what to do with it.
Making a custom control that looks like UISwitch but behaves differently is a bad idea.

iOS accessibility: label vs hint

What is the difference between the "label" and "hint" property if I'm trying to make a control accessible? Moreover, what do the "traits" do? Are all of these properties spoken by VoiceOver if I fill them in?
This is all described in Apple's Accessibility Programming Guide.
But here's my random take on your question:
I would try to think of the accessibility properties in terms of how a sighted person would use your app.
They would look at the display and see stuff.
A button might have a short title, such as "Stop". A slider might have a nearby label saying "Volume". That's the type of stuff that a sight impaired person might like to find in the control's label property.
A sighted person would recognize a standard button or slider by it's shape and decoration. But a vision impaired person might have no clue about that shape. So that's the type of information that should go in the traits property for someone who can't see whether something looks like a button. "button".
If you had a short help document for your app, it might show a picture of your app, with arrows pointing at the elements, and a small bubble caption on each of those arrows saying stuff like "Stops playing annoying fart sounds" and "Changes fart loudness from silent to ear shatteringly gross". These would be your helpful "hints".
Traits and hints are optional, just as some apps in the App store have no help documentation, and weird unrecognizably shaped buttons. But every visible or active control element should have a label.
'zat help?

iPhone application : is-it possible to use a "double" slider to select a price range

I'm working on an iphone application (not web app) and I'd like to build a form asking a user to indicate a price range. Instead of using two text fields, I would prefer to use a double slider to set the minimum and the maximum price. I know that it is possible de use a simple slider (sound control for exemple) but i've never seen a double one. Can anyone help ?
This is not possible without creating a custom control. You'll need to inherit from UIControl or UIView and provide a custom drawRect method. You'll also need to respond to touch and drag events to update the state of the control. I have not done this myself, but I would be prepared for a fairly significant amount of work to get everything to respond and display as expected.
I'm curious as to why you need to have both values specified on a single slider? Why not use two sliders either side-by-side or stacked? It would not require any more input steps than a double slider, and would conform more to standard UI guidelines.
I think you can specify multiple thumbs for a single slider if you subclass UISlider, at least I vaguely remember that being possible in MacOSX. But Code Addict is right, you'll probably be better off using the standard controls - a double-thumbed slider seems like it'd be pretty difficult to deal with in the touchscreen environment.
I built such a control and added it to GitHub so feel free to have a look and if you like the control extend it and contribute.
GitHub page: http://github.com/doukasd/DoubleSlider
Blog post (showing a video of how it works): http://dev.doukasd.com/2010/08/double-slider/